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

Prepare release 5.0 #536

Merged
merged 2 commits into from
May 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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