From eb0a46010a119d3ede2e89e4b0a61cbfb533d473 Mon Sep 17 00:00:00 2001 From: jonathan vanasco Date: Tue, 5 Nov 2019 15:00:05 -0500 Subject: black 19.10b0 was released on 2019.10.28 and introduced several changes that affect Pyramid --- CONTRIBUTORS.txt | 2 ++ src/pyramid/threadlocal.py | 2 +- src/pyramid/traversal.py | 8 ++++---- tests/test_authentication.py | 2 +- tests/test_router.py | 2 +- tests/test_testing.py | 2 +- tests/test_traversal.py | 4 ++-- tests/test_url.py | 2 +- 8 files changed, 13 insertions(+), 11 deletions(-) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index c01dd49b2..6923b975d 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -344,3 +344,5 @@ Contributors - Theron Luhn, 2019/03/30 - Mandar Vaze, 2019/07/20 + +- Jonathan Vanasco, 2019/11/05 diff --git a/src/pyramid/threadlocal.py b/src/pyramid/threadlocal.py index 7eca5b0f0..24bc0ec33 100644 --- a/src/pyramid/threadlocal.py +++ b/src/pyramid/threadlocal.py @@ -55,7 +55,7 @@ def get_current_request(): def get_current_registry( - context=None + context=None, ): # context required by getSiteManager API """ Return the currently active :term:`application registry` or the diff --git a/src/pyramid/traversal.py b/src/pyramid/traversal.py index 9ed5754b7..811c0881b 100644 --- a/src/pyramid/traversal.py +++ b/src/pyramid/traversal.py @@ -708,8 +708,8 @@ class ResourceTreeTraverser(object): ModelGraphTraverser = ( - ResourceTreeTraverser -) # b/w compat, not API, used in wild + ResourceTreeTraverser # b/w compat, not API, used in wild +) @implementer(IResourceURL) @@ -744,8 +744,8 @@ class ResourceURL(object): self.physical_path = physical_path # IResourceURL attr self.virtual_path_tuple = virtual_path_tuple # IResourceURL attr (1.5) self.physical_path_tuple = ( - physical_path_tuple - ) # IResourceURL attr (1.5) + physical_path_tuple # IResourceURL attr (1.5) + ) @lru_cache(1000) diff --git a/tests/test_authentication.py b/tests/test_authentication.py index 710e87423..cb2a0a035 100644 --- a/tests/test_authentication.py +++ b/tests/test_authentication.py @@ -398,7 +398,7 @@ class TestRepozeWho1AuthenticationPolicy(unittest.TestCase): self.assertEqual(policy.effective_principals(request), [Everyone]) def test_effective_principals_repoze_who_userid_is_unclean_Authenticated( - self + self, ): from pyramid.security import Everyone diff --git a/tests/test_router.py b/tests/test_router.py index 722f4286c..f6b7f64d3 100644 --- a/tests/test_router.py +++ b/tests/test_router.py @@ -434,7 +434,7 @@ class TestRouter(unittest.TestCase): self.assertEqual(request.root, context) def test_call_view_registered_nonspecific_nondefault_path_and_subpath( - self + self, ): from pyramid.interfaces import IViewClassifier diff --git a/tests/test_testing.py b/tests/test_testing.py index ebeafe21d..d0e974a58 100644 --- a/tests/test_testing.py +++ b/tests/test_testing.py @@ -55,7 +55,7 @@ class TestDummyResource(unittest.TestCase): return klass(name, parent, **kw) def test__setitem__and__getitem__and__delitem__and__contains__and_get( - self + self, ): class Dummy: pass diff --git a/tests/test_traversal.py b/tests/test_traversal.py index 188ee803c..fdb0bcbb7 100644 --- a/tests/test_traversal.py +++ b/tests/test_traversal.py @@ -1270,8 +1270,8 @@ class DummyContext(object): class DummyRequest: application_url = ( - 'http://example.com:5432' - ) # app_url never ends with slash + 'http://example.com:5432' # app_url never ends with slash + ) matchdict = None matched_route = None diff --git a/tests/test_url.py b/tests/test_url.py index 648f48d53..c5c0ca09f 100644 --- a/tests/test_url.py +++ b/tests/test_url.py @@ -940,7 +940,7 @@ class TestURLMethodsMixin(unittest.TestCase): self.assertEqual(result, 'http://example.com:8080') def test_partial_application_url_with_http_host_nondefault_port_https( - self + self, ): environ = {'wsgi.url_scheme': 'https', 'HTTP_HOST': 'example.com:4443'} request = self._makeOne(environ) -- cgit v1.2.3 From 1d2b4fd13edc972dd4076500b1ec4cb972bef1c9 Mon Sep 17 00:00:00 2001 From: jonathan vanasco Date: Mon, 4 Nov 2019 16:59:41 -0500 Subject: deprecate PickleSerializer --- CHANGES.rst | 2 ++ docs/narr/sessions.rst | 20 +++++++++++++------- src/pyramid/session.py | 20 +++++++++++++++++--- tests/test_session.py | 4 ++++ 4 files changed, 36 insertions(+), 10 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 987d5c3d4..b70e8f4f8 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,6 +4,8 @@ unreleased Features -------- +- Deprecated ``pyramid.session.PickleSerializer``. + - Changed the default ``serializer`` on ``pyramid.session.SignedCookieSessionFactory`` to use ``pyramid.session.JSONSerializer`` instead of diff --git a/docs/narr/sessions.rst b/docs/narr/sessions.rst index c2cc60de8..413dc5b8e 100644 --- a/docs/narr/sessions.rst +++ b/docs/narr/sessions.rst @@ -91,26 +91,32 @@ Remember that sessions should be short-lived and thus the number of clients affe .. code-block:: python :linenos: + import pickle from pyramid.session import JSONSerializer - from pyramid.session import PickleSerializer from pyramid.session import SignedCookieSessionFactory + class JSONSerializerWithPickleFallback(object): def __init__(self): self.json = JSONSerializer() - self.pickle = PickleSerializer() - def dumps(self, value): + def dumps(self, appstruct): + """Accept a Python object and return bytes.""" # maybe catch serialization errors here and keep using pickle # while finding spots in your app that are not storing # JSON-serializable objects, falling back to pickle - return self.json.dumps(value) + return self.json.dumps(appstruct) - def loads(self, value): + def loads(self, bstruct): + """Accept bytes and return a Python object.""" try: - return self.json.loads(value) + return self.json.loads(bstruct) except ValueError: - return self.pickle.loads(value) + try: + return pickle.loads(bstruct) + # at least ValueError, AttributeError, ImportError but more to be safe + except Exception: + raise ValueError # somewhere in your configuration code serializer = JSONSerializerWithPickleFallback() diff --git a/src/pyramid/session.py b/src/pyramid/session.py index 70ac4f55f..adfe28a39 100644 --- a/src/pyramid/session.py +++ b/src/pyramid/session.py @@ -44,10 +44,24 @@ def manage_changed(wrapped): class PickleSerializer(object): - """ A serializer that uses the pickle protocol to dump Python - data to bytes. + """ + .. deprecated:: 2.0 + + .. warning:: + + In :app:`Pyramid` 2.0 the default ``serializer`` option changed to + use :class:`pyramid.session.JSONSerializer`, and ``PickleSerializer` + has been been removed from active Pyramid code. + + Pyramid will require JSON-serializable objects in :app:`Pyramid` 2.0. + + Please see :ref:`pickle_session_deprecation`. + + Also, please see: #2709, #3353, #3413 + + A serializer that uses the pickle protocol to dump Python data to bytes. - This is the default serializer used by Pyramid. + This was the default serializer used by Pyramid, but has been deprecated. ``protocol`` may be specified to control the version of pickle used. Defaults to :attr:`pickle.HIGHEST_PROTOCOL`. diff --git a/tests/test_session.py b/tests/test_session.py index 8e5e82bb2..582a7ed4a 100644 --- a/tests/test_session.py +++ b/tests/test_session.py @@ -564,6 +564,10 @@ class Test_manage_changed(unittest.TestCase): class TestPickleSerializer(unittest.TestCase): + """ + .. deprecated:: 2.0 + """ + def _makeOne(self): from pyramid.session import PickleSerializer -- cgit v1.2.3 From 9264004c92adf731cd8164a63e199558ffdd2751 Mon Sep 17 00:00:00 2001 From: jonathan vanasco Date: Mon, 4 Nov 2019 17:45:44 -0500 Subject: changes based on feedback --- docs/narr/sessions.rst | 15 ++++++++++----- src/pyramid/session.py | 32 +++++++++++++++++++++----------- 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/docs/narr/sessions.rst b/docs/narr/sessions.rst index 413dc5b8e..d9befec82 100644 --- a/docs/narr/sessions.rst +++ b/docs/narr/sessions.rst @@ -101,10 +101,14 @@ Remember that sessions should be short-lived and thus the number of clients affe self.json = JSONSerializer() def dumps(self, appstruct): - """Accept a Python object and return bytes.""" - # maybe catch serialization errors here and keep using pickle - # while finding spots in your app that are not storing - # JSON-serializable objects, falling back to pickle + """ + Accept a Python object and return bytes. + + During a migration, you may want to catch serialization errors here, + and keep using pickle while finding spots in your app that are not + storing JSON-serializable objects. You may also want to integrate + a fall-back to picke serialization here as well. + """ return self.json.dumps(appstruct) def loads(self, bstruct): @@ -114,8 +118,9 @@ Remember that sessions should be short-lived and thus the number of clients affe except ValueError: try: return pickle.loads(bstruct) - # at least ValueError, AttributeError, ImportError but more to be safe except Exception: + # this block should catch at least: + # ValueError, AttributeError, ImportError; but more to be safe raise ValueError # somewhere in your configuration code diff --git a/src/pyramid/session.py b/src/pyramid/session.py index adfe28a39..efac52140 100644 --- a/src/pyramid/session.py +++ b/src/pyramid/session.py @@ -49,15 +49,24 @@ class PickleSerializer(object): .. warning:: - In :app:`Pyramid` 2.0 the default ``serializer`` option changed to - use :class:`pyramid.session.JSONSerializer`, and ``PickleSerializer` - has been been removed from active Pyramid code. + In :app:`Pyramid` 2.0 the default ``serializer`` option changed to + use :class:`pyramid.session.JSONSerializer`, and ``PickleSerializer` + has been been removed from active Pyramid code. - Pyramid will require JSON-serializable objects in :app:`Pyramid` 2.0. + Pyramid will require JSON-serializable objects in :app:`Pyramid` 2.0. - Please see :ref:`pickle_session_deprecation`. + Please see :ref:`pickle_session_deprecation`. - Also, please see: #2709, #3353, #3413 + Also, please see these tickets: + + * 2.0 feature request: Require that sessions are JSON serializable #2709 + https://github.com/pylons/pyramid/issues/2709 + + * deprecate pickleable sessions, recommend json #3353 + https://github.com/Pylons/pyramid/pull/3353 + + * change to use JSONSerializer for SignedCookieSessionFactory #3413 + https://github.com/Pylons/pyramid/pull/3413 A serializer that uses the pickle protocol to dump Python data to bytes. @@ -75,8 +84,9 @@ class PickleSerializer(object): """Accept bytes and return a Python object.""" try: return pickle.loads(bstruct) - # at least ValueError, AttributeError, ImportError but more to be safe except Exception: + # this block should catch at least: + # ValueError, AttributeError, ImportError; but more to be safe raise ValueError def dumps(self, appstruct): @@ -452,10 +462,10 @@ def SignedCookieSessionFactory( .. warning:: - In :app:`Pyramid` 2.0 the default ``serializer`` option changed to - use :class:`pyramid.session.JSONSerializer`. See - :ref:`pickle_session_deprecation` for more information about why this - change was made. + In :app:`Pyramid` 2.0 the default ``serializer`` option changed to + use :class:`pyramid.session.JSONSerializer`. See + :ref:`pickle_session_deprecation` for more information about why this + change was made. .. versionadded: 1.5a3 -- cgit v1.2.3 From b6604fc39e542a78bc6cb4f009bf972ba4db098f Mon Sep 17 00:00:00 2001 From: jonathan vanasco Date: Mon, 4 Nov 2019 17:47:03 -0500 Subject: updated docstring issuet --- src/pyramid/session.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pyramid/session.py b/src/pyramid/session.py index efac52140..d317b7c48 100644 --- a/src/pyramid/session.py +++ b/src/pyramid/session.py @@ -50,7 +50,7 @@ class PickleSerializer(object): .. warning:: In :app:`Pyramid` 2.0 the default ``serializer`` option changed to - use :class:`pyramid.session.JSONSerializer`, and ``PickleSerializer` + use :class:`pyramid.session.JSONSerializer`, and ``PickleSerializer`` has been been removed from active Pyramid code. Pyramid will require JSON-serializable objects in :app:`Pyramid` 2.0. @@ -74,7 +74,6 @@ class PickleSerializer(object): ``protocol`` may be specified to control the version of pickle used. Defaults to :attr:`pickle.HIGHEST_PROTOCOL`. - """ def __init__(self, protocol=pickle.HIGHEST_PROTOCOL): -- cgit v1.2.3 From 3bc31c66c41f795abdaa270645f1046f70a86e07 Mon Sep 17 00:00:00 2001 From: jonathan vanasco Date: Mon, 4 Nov 2019 17:56:27 -0500 Subject: fixed rst; migrated some inline references to the docs --- docs/narr/sessions.rst | 6 ++++++ src/pyramid/session.py | 11 ----------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/docs/narr/sessions.rst b/docs/narr/sessions.rst index d9befec82..8ae20d63e 100644 --- a/docs/narr/sessions.rst +++ b/docs/narr/sessions.rst @@ -85,6 +85,12 @@ This is a stricter contract than the previous requirement that all objects be pi This is a backward-incompatible change. Previously, if a client-side session implementation was compromised, it left the application vulnerable to remote code execution attacks using specially-crafted sessions that execute code when deserialized. +Please reference the following tickets if detailed information on these changes is needed: + +* `2.0 feature request: Require that sessions are JSON serializable #2709 `_. +* `deprecate pickleable sessions, recommend json #3353 `_. +* `change to use JSONSerializer for SignedCookieSessionFactory #3413 `_. + For users with compatibility concerns, it's possible to craft a serializer that can handle both formats until you are satisfied that clients have had time to reasonably upgrade. Remember that sessions should be short-lived and thus the number of clients affected should be small (no longer than an auth token, at a maximum). An example serializer: diff --git a/src/pyramid/session.py b/src/pyramid/session.py index d317b7c48..ededdaab7 100644 --- a/src/pyramid/session.py +++ b/src/pyramid/session.py @@ -57,17 +57,6 @@ class PickleSerializer(object): Please see :ref:`pickle_session_deprecation`. - Also, please see these tickets: - - * 2.0 feature request: Require that sessions are JSON serializable #2709 - https://github.com/pylons/pyramid/issues/2709 - - * deprecate pickleable sessions, recommend json #3353 - https://github.com/Pylons/pyramid/pull/3353 - - * change to use JSONSerializer for SignedCookieSessionFactory #3413 - https://github.com/Pylons/pyramid/pull/3413 - A serializer that uses the pickle protocol to dump Python data to bytes. This was the default serializer used by Pyramid, but has been deprecated. -- cgit v1.2.3 From 24c19c8780379c77dc1cf5567d8cf18009d4d780 Mon Sep 17 00:00:00 2001 From: jonathan vanasco Date: Tue, 5 Nov 2019 11:42:08 -0500 Subject: typo and tabs --- docs/narr/sessions.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/narr/sessions.rst b/docs/narr/sessions.rst index 8ae20d63e..2da524d4c 100644 --- a/docs/narr/sessions.rst +++ b/docs/narr/sessions.rst @@ -113,7 +113,7 @@ Remember that sessions should be short-lived and thus the number of clients affe During a migration, you may want to catch serialization errors here, and keep using pickle while finding spots in your app that are not storing JSON-serializable objects. You may also want to integrate - a fall-back to picke serialization here as well. + a fall-back to pickle serialization here as well. """ return self.json.dumps(appstruct) @@ -125,8 +125,8 @@ Remember that sessions should be short-lived and thus the number of clients affe try: return pickle.loads(bstruct) except Exception: - # this block should catch at least: - # ValueError, AttributeError, ImportError; but more to be safe + # this block should catch at least: + # ValueError, AttributeError, ImportError; but more to be safe raise ValueError # somewhere in your configuration code -- cgit v1.2.3 From d118466861373a80494dd343fe950b0d87ecda51 Mon Sep 17 00:00:00 2001 From: jonathan vanasco Date: Tue, 5 Nov 2019 13:45:49 -0500 Subject: updated changes signed main repo contributors --- CHANGES.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index b70e8f4f8..537ca4671 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,6 +5,9 @@ Features -------- - Deprecated ``pyramid.session.PickleSerializer``. + See https://github.com/pylons/pyramid/issues/2709 + and https://github.com/pylons/pyramid/pull/3353 + and https://github.com/pylons/pyramid/pull/3413 - Changed the default ``serializer`` on ``pyramid.session.SignedCookieSessionFactory`` to use -- cgit v1.2.3 From 5a77d1dc082d0f2cedc7320616f2d96f61a3ed9c Mon Sep 17 00:00:00 2001 From: jonathan vanasco Date: Tue, 5 Nov 2019 17:04:11 -0500 Subject: invoke `deprecated()` --- src/pyramid/session.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/pyramid/session.py b/src/pyramid/session.py index ededdaab7..10e1ea313 100644 --- a/src/pyramid/session.py +++ b/src/pyramid/session.py @@ -82,6 +82,14 @@ class PickleSerializer(object): return pickle.dumps(appstruct, self.protocol) +deprecated( + 'PickleSerializer', + 'pyramid.session.PickleSerializer is deprecated as of Pyramid 2.0 for ' + 'security concerns. Use pyramid.session.JSONSerializer or reference the ' + 'narrative documentation for information on building a migration tool.', +) + + JSONSerializer = JSONSerializer # api -- cgit v1.2.3 From 150fff0ffcf86aabf551b17cdd75e9aa5ff55fb4 Mon Sep 17 00:00:00 2001 From: Jan Likar Date: Thu, 7 Nov 2019 05:52:56 +0100 Subject: Fix a typo in a class reference --- docs/whatsnew-2.0.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/whatsnew-2.0.rst b/docs/whatsnew-2.0.rst index bf1554a27..ec506894e 100644 --- a/docs/whatsnew-2.0.rst +++ b/docs/whatsnew-2.0.rst @@ -56,7 +56,7 @@ flexibility in authorization implementations, especially those that do not match the ACL pattern. If you were previously using :class:`pyramid.authorization.ACLAuthorizationPolicy`, you can achieve the same results by writing your own ``permits`` method using -:class:`pyraid.authorization.ACLHelper`. For more details on implementing an +:class:`pyramid.authorization.ACLHelper`. For more details on implementing an ACL, see :ref:`assigning_acls`. Pyramid does not provide any built-in security policies. Similiar -- cgit v1.2.3 From 11f3a63715022f71068e9ce7e7dda63400dfbdae Mon Sep 17 00:00:00 2001 From: Jan Likar Date: Thu, 7 Nov 2019 05:58:51 +0100 Subject: Sign contributor agreement --- CONTRIBUTORS.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 6923b975d..f41e5fdb5 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -346,3 +346,5 @@ Contributors - Mandar Vaze, 2019/07/20 - Jonathan Vanasco, 2019/11/05 + +- Jan Likar, 2019/11/07 -- cgit v1.2.3 From 9ffdc7c9270ca9ef25ed01495e5f210db9d37710 Mon Sep 17 00:00:00 2001 From: Andrea Borghi Date: Mon, 11 Nov 2019 14:18:35 +0100 Subject: ZopeTransactionExtension is not valid anymore, replace with zope.sqlalchemy.register The new version of zope.sqlalchemy does not provide ZopeTransactionExtension anymore. As stated in (this official PR)[https://github.com/zopefoundation/zope.sqlalchemy/pull/38] --- docs/quick_tutorial/databases/tutorial/models.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/quick_tutorial/databases/tutorial/models.py b/docs/quick_tutorial/databases/tutorial/models.py index b27c38417..2d70e0db6 100644 --- a/docs/quick_tutorial/databases/tutorial/models.py +++ b/docs/quick_tutorial/databases/tutorial/models.py @@ -13,10 +13,10 @@ from sqlalchemy.orm import ( sessionmaker, ) -from zope.sqlalchemy import ZopeTransactionExtension +from zope.sqlalchemy import register -DBSession = scoped_session( - sessionmaker(extension=ZopeTransactionExtension())) +DBSession = scoped_session(sessionmaker(autoflush=False)) +register(DBSession) Base = declarative_base() @@ -32,4 +32,4 @@ class Root(object): (Allow, 'group:editors', 'edit')] def __init__(self, request): - pass \ No newline at end of file + pass -- cgit v1.2.3 From 418e64eb644f7a850ec87002ec8c875eb8b1b843 Mon Sep 17 00:00:00 2001 From: Andrea Borghi Date: Mon, 11 Nov 2019 14:55:32 +0100 Subject: remove autoflush=False autoflush is necessary for the current implementation views.py --- docs/quick_tutorial/databases/tutorial/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/quick_tutorial/databases/tutorial/models.py b/docs/quick_tutorial/databases/tutorial/models.py index 2d70e0db6..8e6649d49 100644 --- a/docs/quick_tutorial/databases/tutorial/models.py +++ b/docs/quick_tutorial/databases/tutorial/models.py @@ -15,7 +15,7 @@ from sqlalchemy.orm import ( from zope.sqlalchemy import register -DBSession = scoped_session(sessionmaker(autoflush=False)) +DBSession = scoped_session(sessionmaker()) register(DBSession) Base = declarative_base() -- cgit v1.2.3 From 85a98147d4098593b7ff6781a140ddea6a0b523f Mon Sep 17 00:00:00 2001 From: Andrea Borghi Date: Mon, 11 Nov 2019 15:56:07 +0100 Subject: sign CONTRIBUORS.txt chart --- CONTRIBUTORS.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index f41e5fdb5..65be5e259 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -348,3 +348,5 @@ Contributors - Jonathan Vanasco, 2019/11/05 - Jan Likar, 2019/11/07 + +- Andrea Borghi, 2019/11/11 -- cgit v1.2.3 From d9dadcfabccb8895eda1fa948f7d7d6686e53806 Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Wed, 4 Dec 2019 21:38:17 -0600 Subject: add missing versionadded directive on config.add_cache_buster --- src/pyramid/config/views.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pyramid/config/views.py b/src/pyramid/config/views.py index afb685f93..bc0b05a08 100644 --- a/src/pyramid/config/views.py +++ b/src/pyramid/config/views.py @@ -2045,6 +2045,8 @@ class ViewsConfiguratorMixin(object): :class:`~pyramid.interfaces.ICacheBuster` interface. Default: ``False``. + .. versionadded:: 1.6 + """ spec = self._make_spec(path) info = self._get_static_info() -- cgit v1.2.3 From 3737d3408f0c393251bd04d53210e605300cdab5 Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Wed, 4 Dec 2019 23:05:17 -0600 Subject: fix instructions in hacking.txt after refactoring --- HACKING.txt | 6 +++--- setup.cfg | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/HACKING.txt b/HACKING.txt index 901eb8518..5ccc318de 100644 --- a/HACKING.txt +++ b/HACKING.txt @@ -74,10 +74,10 @@ Running Tests to your virtual environment: # run a single test - $ $VENV/bin/nosetests pyramid.tests.test_module:ClassName.test_mytestname + $ $VENV/bin/nosetests tests.test_module:ClassName.test_mytestname # run all tests in a class - $ $VENV/bin/nosetests pyramid.tests.test_module:ClassName + $ $VENV/bin/nosetests tests.test_module:ClassName Optionally you can install a nose plugin `nose-selecttests` to run specific tests. @@ -93,7 +93,7 @@ Running Tests tests like so: $ $VENV/bin/pip install pytest - $ $VENV/bin/pytest --strict pyramid/ + $ $VENV/bin/pytest --strict pyramid/ tests/ To run individual tests (i.e., during development), see "pytest usage - Specifying tests / selecting tests": diff --git a/setup.cfg b/setup.cfg index 3e10bb55b..19f338b91 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,7 +3,6 @@ zip_ok = false [nosetests] match = ^test -tests = tests nocapture = 1 [aliases] -- cgit v1.2.3 From 7150c3b1bd0a9a5a2ce3ff5af81f4407e7f314f9 Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Wed, 4 Dec 2019 23:46:55 -0600 Subject: move deprecation into deprecations section --- CHANGES.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 537ca4671..936d487bf 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,11 +4,6 @@ unreleased Features -------- -- Deprecated ``pyramid.session.PickleSerializer``. - See https://github.com/pylons/pyramid/issues/2709 - and https://github.com/pylons/pyramid/pull/3353 - and https://github.com/pylons/pyramid/pull/3413 - - Changed the default ``serializer`` on ``pyramid.session.SignedCookieSessionFactory`` to use ``pyramid.session.JSONSerializer`` instead of @@ -67,6 +62,11 @@ Features Deprecations ------------ +- Deprecated ``pyramid.session.PickleSerializer``. + See https://github.com/pylons/pyramid/issues/2709 + and https://github.com/pylons/pyramid/pull/3353 + and https://github.com/pylons/pyramid/pull/3413 + Backward Incompatibilities -------------------------- -- cgit v1.2.3 From e6526f599bf4c98f9d7524f05203ee839b1b6c0a Mon Sep 17 00:00:00 2001 From: Behzod Saidov Date: Mon, 9 Dec 2019 14:29:57 -0800 Subject: Fixed typo. Remove extra $. --- docs/quick_tutorial/json.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/quick_tutorial/json.rst b/docs/quick_tutorial/json.rst index 44d1de8cb..19d346199 100644 --- a/docs/quick_tutorial/json.rst +++ b/docs/quick_tutorial/json.rst @@ -63,7 +63,7 @@ Steps .. code-block:: bash - $ $VENV/bin/pserve development.ini --reload + $VENV/bin/pserve development.ini --reload #. Open http://localhost:6543/howdy.json in your browser and you will see the resulting JSON response. -- cgit v1.2.3 From 70abeebc3d1d075eb5846f670ddaf9e4eed9e61d Mon Sep 17 00:00:00 2001 From: Behzod Saidov Date: Mon, 9 Dec 2019 14:39:51 -0800 Subject: view_classes.rst doc: "classes" -> "functions" --- docs/quick_tutorial/view_classes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/quick_tutorial/view_classes.rst b/docs/quick_tutorial/view_classes.rst index 1307857b7..c9f61f5a3 100644 --- a/docs/quick_tutorial/view_classes.rst +++ b/docs/quick_tutorial/view_classes.rst @@ -78,7 +78,7 @@ To ease the transition to view classes, we didn't introduce any new functionality. We simply changed the view functions to methods on a view class, then updated the tests. -In our ``TutorialViews`` view class, you can see that our two view classes are +In our ``TutorialViews`` view class, you can see that our two view functions are logically grouped together as methods on a common class. Since the two views shared the same template, we could move that to a ``@view_defaults`` decorator at the class level. -- cgit v1.2.3