Skip to content

Commit

Permalink
Merge pull request #536 from Cornices/prepare-release-5.0
Browse files Browse the repository at this point in the history
Prepare release 5.0
  • Loading branch information
leplatrem authored May 20, 2020
2 parents d3a43bc + 653e93d commit 241542e
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
6 changes: 5 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
CHANGELOG
#########

4.1.0 (unreleased)
5.0.0 (2020-05-19)
==================

**Breaking Changes**

- Drop Python 2 support
- The default JSON renderer does not use ``simplejson.dumps()`` by default anymore, so the requirement has been dropped.

Please refer to `upgrading docs <https://cornice.readthedocs.io/en/stable/upgrading.html>`_ for detailed migration instructions.


4.0.1 (2019-12-02)
==================
Expand Down
29 changes: 29 additions & 0 deletions docs/source/upgrading.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,35 @@
Upgrading
#########

4.X to 5.X
==========

Upgrade your codebase to Python 3.

In order to keep using ``simplejson`` with this release, add it explicitly as your project dependencies, and set it explicitly as the default renderer:

.. code-block:: python
import simplejson
from cornice.render import CorniceRenderer
class SimpleJSONRenderer(CorniceRenderer):
def __init__(self, **kwargs):
kwargs["serializer"] = simplejson.dumps
config.add_renderer(None, SimpleJSONRenderer())
See https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/renderers.html


3.X to 4.X
==========

``request.validated`` is now always a ``colander.MappingSchema`` instance (``dict``) when using ``colander_*_validator()`` functions.

In order to use a different type (eg. ``SequenceSchema``), use ``colander_validator()`` and read it from ``request.validated['body']``.


2.X to 3.X
==========

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package_data = {}

setup(name='cornice',
version='4.1.0.dev0',
version='5.0.0',
description='Define Web Services in Pyramid.',
long_description=README + '\n\n' + CHANGES,
license='MPLv2.0',
Expand Down

0 comments on commit 241542e

Please sign in to comment.