Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update webargs to 5.1.2 #233

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pyup-bot
Copy link
Contributor

@pyup-bot pyup-bot commented Feb 4, 2019

This PR updates webargs from 1.8.1 to 5.1.2.

Changelog

5.1.2

******************

Bug fixes:

* Remove lingering usages of ``ValidationError.status_code``
(:issue:`365`). Thanks :user:`decaz` for reporting.
* Avoid ``AttributeError`` on Python<3.5.4 (:issue:`366`).
* Fix incorrect type annotations for ``error_headers``.
* Fix outdated docs (:issue:`367`). Thanks :user:`alexandersoto` for reporting.

5.1.1.post0

************************

* Include LICENSE in sdist (:issue:`364`).

5.1.1

******************

Bug fixes:

* Fix installing ``simplejson`` on Python 2 by
distributing a Python 2-only wheel (:issue:`363`).

5.1.0

******************

Features:

* Error handlers for `AsyncParser` classes may be coroutine functions.
* Add type annotations to `AsyncParser` and `AIOHTTPParser`.

Bug fixes:

* Fix compatibility with Flask<1.0 (:issue:`355`).
Thanks :user:`hoatle` for reporting.
* Address warning on Python 3.7 about importing from ``collections.abc``.

5.0.0

******************

Features:

* *Backwards-incompatible*: A 400 HTTPError is raised when an
invalid JSON payload is passed.  (:issue:`329`).
Thanks :user:`zedrdave` for reporting.

Other changes:

* *Backwards-incompatible*: `webargs.argmap2schema` is removed. Use
`webargs.dict2schema` instead.
* *Backwards-incompatible*: `webargs.ValidationError` is removed.
Use `marshmallow.ValidationError` instead.


.. code-block:: python

  <5.0.0
 from webargs import ValidationError


 def auth_validator(value):
      ...
     raise ValidationError("Authentication failed", status_code=401)


 use_args({"auth": fields.Field(validate=auth_validator)})
 def auth_view(args):
     return jsonify(args)


  >=5.0.0
 from marshmallow import ValidationError


 def auth_validator(value):
      ...
     raise ValidationError("Authentication failed")


 use_args({"auth": fields.Field(validate=auth_validator)}, error_status_code=401)
 def auth_view(args):
     return jsonify(args)


* *Backwards-incompatible*: Missing arguments will no longer be filled
in when using ``use_kwargs`` (:issue:`342,307,252`). Use ``**kwargs``
to account for non-required fields.

.. code-block:: python

  <5.0.0
 use_kwargs(
     {"first_name": fields.Str(required=True), "last_name": fields.Str(required=False)}
 )
 def myview(first_name, last_name):
      last_name is webargs.missing if it's missing from the request
     return {"first_name": first_name}


  >=5.0.0
 use_kwargs(
     {"first_name": fields.Str(required=True), "last_name": fields.Str(required=False)}
 )
 def myview(first_name, **kwargs):
      last_name will not be in kwargs if it's missing from the request
     return {"first_name": first_name}


* `simplejson <https://pypi.org/project/simplejson/>`_ is now a required
dependency on Python 2 (:pr:`334`).
This ensures consistency of behavior across Python 2 and 3.

4.4.1

******************

Bug fixes:

* Remove usages of ``argmap2schema`` from ``fields.Nested``,
``AsyncParser``, and ``PyramidParser``.

4.4.0

******************

* *Deprecation*: ``argmap2schema`` is deprecated in favor of
``dict2schema`` (:pr:`352`).

4.3.1

******************

* Add ``force_all`` param to ``PyramidParser.use_args``.
* Add warning about missing arguments to ``AsyncParser``.

4.3.0

******************

* *Deprecation*: Add warning about missing arguments getting added
to parsed arguments dictionary (:issue:`342`). This behavior will be
removed in version 5.0.0.

4.2.0

******************

Features:

* Add ``force_all`` argument to ``use_args`` and ``use_kwargs``
(:issue:`252`, :issue:`307`). Thanks :user:`piroux` for reporting.
* *Deprecation*: The ``status_code`` and ``headers`` arguments to ``ValidationError``
are deprecated. Pass ``error_status_code`` and ``error_headers`` to
`Parser.parse`, `Parser.use_args`, and `Parser.use_kwargs` instead.
(:issue:`327`, :issue:`336`).
* Custom error handlers receive ``error_status_code`` and ``error_headers`` arguments.
(:issue:`327`).

.. code-block:: python

  <4.2.0
 parser.error_handler
 def handle_error(error, req, schema):
     raise CustomError(error.messages)


 class MyParser(FlaskParser):
     def handle_error(self, error, req, schema):
          ...
         raise CustomError(error.messages)


  >=4.2.0
 parser.error_handler
 def handle_error(error, req, schema, status_code, headers):
     raise CustomError(error.messages)


  OR


 parser.error_handler
 def handle_error(error, **kwargs):
     raise CustomError(error.messages)


 class MyParser(FlaskParser):
     def handle_error(self, error, req, schema, status_code, headers):
          ...
         raise CustomError(error.messages)

      OR

     def handle_error(self, error, req, **kwargs):
          ...
         raise CustomError(error.messages)

Legacy error handlers will be supported until version 5.0.0.

4.1.3

******************

Bug fixes:

* Fix bug in ``AIOHTTParser`` that prevented calling
``use_args`` on the same view function multiple times (:issue:`273`).
Thanks to :user:`dnp1` for reporting and :user:`jangelo` for the fix.
* Fix compatibility with marshmallow 3.0.0rc1 (:pr:`330`).

4.1.2

******************

Bug fixes:

* Fix serialization behavior of ``DelimitedList`` (:pr:`319`).
Thanks :user:`lee3164` for the PR.

Other changes:

* Test against Python 3.7.

4.1.1

******************

Bug fixes:

* Fix bug in ``AIOHTTPParser`` that caused a ``JSONDecode`` error
when parsing empty payloads (:issue:`229`). Thanks :user:`explosic4`
for reporting and thanks user :user:`kochab` for the PR.

4.1.0

******************

Features:

* Add ``webargs.testing`` module, which exposes ``CommonTestCase``
to third-party parser libraries (see comments in :pr:`287`).

4.0.0

******************

Features:

* *Backwards-incompatible*: Custom error handlers receive the
`marshmallow.Schema` instance as the third argument. Update any
functions decorated with `Parser.error_handler` to take a ``schema``
argument, like so:

.. code-block:: python

  3.x
 parser.error_handler
 def handle_error(error, req):
     raise CustomError(error.messages)


  4.x
 parser.error_handler
 def handle_error(error, req, schema):
     raise CustomError(error.messages)


See `marshmallow-code/marshmallow840 (comment) <https://github.com/marshmallow-code/marshmallow/issues/840issuecomment-403481686>`_
for more information about this change.

Bug fixes:

* *Backwards-incompatible*: Rename ``webargs.async`` to
``webargs.asyncparser`` to fix compatibility with Python 3.7
(:issue:`240`). Thanks :user:`Reskov` for the catch and patch.


Other changes:

* *Backwards-incompatible*: Drop support for Python 3.4 (:pr:`243`). Python 2.7 and
>=3.5 are supported.
* *Backwards-incompatible*: Drop support for marshmallow<2.15.0.
marshmallow>=2.15.0 and >=3.0.0b12 are officially supported.
* Use `black <https://github.com/ambv/black>`_ with `pre-commit <https://pre-commit.com/>`_
for code formatting (:pr:`244`).

3.0.2

******************

Bug fixes:

* Fix compatibility with marshmallow 3.0.0b12 (:pr:`242`). Thanks :user:`lafrech`.

3.0.1

******************

Bug fixes:

* Respect `Parser.DEFAULT_VALIDATION_STATUS` when a `status_code` is not
explicitly passed to `ValidationError` (:issue:`180`). Thanks :user:`foresmac` for
finding this.

Support:

* Add "Returning HTTP 400 Responses" section to docs (:issue:`180`).

3.0.0

******************

Changes:

* *Backwards-incompatible*: Custom error handlers receive the request object as the second
argument. Update any functions decorated with ``Parser.error_handler`` to take a `req` argument, like so:

.. code-block:: python

  2.x
 parser.error_handler
 def handle_error(error):
     raise CustomError(error.messages)


  3.x
 parser.error_handler
 def handle_error(error, req):
     raise CustomError(error.messages)

* *Backwards-incompatible*: Remove unused ``instance`` and ``kwargs`` arguments of ``argmap2schema``.
* *Backwards-incompatible*: Remove ``Parser.load`` method (``Parser`` now calls ``Schema.load`` directly).

These changes shouldn't affect most users. However, they might break custom parsers calling these methods. (:pr:`222`)

* Drop support for aiohttp<3.0.0.

2.1.0

******************

Features:

* Respect ``data_key`` field argument (in marshmallow 3). Thanks
:user:`lafrech`.

2.0.0

******************

Changes:

* Drop support for aiohttp<2.0.0.
* Remove use of deprecated `Request.has_body` attribute in
aiohttpparser (:issue:`186`). Thanks :user:`ariddell` for reporting.

1.10.0

*******************

Features:

* Add support for marshmallow>=3.0.0b7 (:pr:`188`). Thanks
:user:`lafrech`.

Deprecations:

* Support for aiohttp<2.0.0 is deprecated and will be removed in webargs 2.0.0.

1.9.0

******************

Changes:

* ``HTTPExceptions`` raised with `webargs.flaskparser.abort` will always
have the ``data`` attribute, even if no additional keywords arguments
are passed (:pr:`184`). Thanks :user:`lafrech`.

Support:

* Fix examples in examples/ directory.
Links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant