Skip to content

Commit

Permalink
Merge pull request Pylons#3689 from ergo/master
Browse files Browse the repository at this point in the history
Add support for Python 3.10
  • Loading branch information
digitalresistor authored Feb 6, 2022
2 parents 0b24ac1 + b492e30 commit 2efb134
Show file tree
Hide file tree
Showing 19 changed files with 105 additions and 105 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
strategy:
matrix:
py:
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "pypy3"
- "3.10"
- "pypy-3.8"
os:
- "ubuntu-latest"
- "windows-latest"
Expand All @@ -33,7 +33,7 @@ jobs:
- os: "ubuntu-latest"
pytest-args: "--cov"
- os: "ubuntu-latest"
py: "pypy3"
py: "pypy-3.8"
pytest-args: ""

exclude:
Expand All @@ -44,7 +44,7 @@ jobs:
architecture: x86
# PyPy3 on Windows doesn't seem to work
- os: "windows-latest"
py: "pypy3"
py: "pypy-3.8"

name: "Python: ${{ matrix.py }}-${{ matrix.architecture }} on ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
Expand Down
8 changes: 4 additions & 4 deletions HACKING.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ In order to add a feature to Pyramid:
- The feature must be documented in both the API and narrative documentation
(in `docs/`).

- The feature must work fully on the following CPython versions: 3.6, 3.7, 3.8, and 3.9 on both UNIX and Windows.
- The feature must work fully on the following CPython versions: 3.7, 3.8, 3.9, and 3.10 on both UNIX and Windows.

- The feature must work on the latest version of PyPy3.

Expand Down Expand Up @@ -80,9 +80,9 @@ Running Tests

$ $TOX -e py

To run `tox` for Python 3.9 explicitly, you may use:
To run `tox` for Python 3.10 explicitly, you may use:

$ $TOX -e py39
$ $TOX -e py310

- To run individual tests (i.e., during development), you can use `pytest`
syntax as follows, where `$VENV` is an environment variable set to the path
Expand All @@ -103,7 +103,7 @@ Test Coverage
-------------

- The codebase *must* have 100% test statement coverage after each commit. You
can test coverage via `tox -e py39`.
can test coverage via `tox -e py310`.


Documentation Coverage and Building HTML Documentation
Expand Down
2 changes: 1 addition & 1 deletion docs/narr/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ the following sections.

.. sidebar:: Python Versions

As of this writing, :app:`Pyramid` is tested against Python 3.6, 3.7, 3.8, and 3.9 and PyPy3.
As of this writing, :app:`Pyramid` is tested against Python 3.7, 3.8, 3.9, and 3.10 and PyPy3.

:app:`Pyramid` is known to run on all popular Unix-like systems such as Linux,
macOS, and FreeBSD, as well as on Windows platforms. It is also known to
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ def readfile(name):
"Intended Audience :: Developers",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Framework :: Pyramid",
Expand Down
22 changes: 11 additions & 11 deletions src/pyramid/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@


class CallbackAuthenticationPolicy:
""" Abstract class """
"""Abstract class"""

debug = False
callback = None
Expand Down Expand Up @@ -265,7 +265,7 @@ def authenticated_userid(self, request):
return userid

def unauthenticated_userid(self, request):
""" Return the ``repoze.who.userid`` key from the detected identity."""
"""Return the ``repoze.who.userid`` key from the detected identity."""
identity = self._get_identity(request)
if identity is None:
return None
Expand Down Expand Up @@ -411,7 +411,7 @@ def __init__(self, environ_key='REMOTE_USER', callback=None, debug=False):
self.debug = debug

def unauthenticated_userid(self, request):
""" The ``REMOTE_USER`` value found within the ``environ``."""
"""The ``REMOTE_USER`` value found within the ``environ``."""
return request.environ.get(self.environ_key)

def remember(self, request, userid, **kw):
Expand Down Expand Up @@ -631,7 +631,7 @@ def __init__(
self.debug = debug

def unauthenticated_userid(self, request):
""" The userid key within the auth_tkt cookie."""
"""The userid key within the auth_tkt cookie."""
result = self.cookie.identify(request)
if result:
return result['userid']
Expand All @@ -647,7 +647,7 @@ def remember(self, request, userid, **kw):
return self.cookie.remember(request, userid, **kw)

def forget(self, request):
""" A list of headers which will delete appropriate cookies."""
"""A list of headers which will delete appropriate cookies."""
return self.cookie.forget(request)


Expand Down Expand Up @@ -1235,11 +1235,11 @@ def __init__(self, prefix='auth.', callback=None, debug=False):
self.helper = SessionAuthenticationHelper(prefix)

def remember(self, request, userid, **kw):
""" Store a userid in the session."""
"""Store a userid in the session."""
return self.helper.remember(request, userid, **kw)

def forget(self, request):
""" Remove the stored userid from the session."""
"""Remove the stored userid from the session."""
return self.helper.forget(request)

def unauthenticated_userid(self, request):
Expand All @@ -1263,18 +1263,18 @@ def __init__(self, prefix='auth.'):
self.userid_key = prefix + 'userid'

def remember(self, request, userid, **kw):
""" Store a userid in the session."""
"""Store a userid in the session."""
request.session[self.userid_key] = userid
return []

def forget(self, request, **kw):
""" Remove the stored userid from the session."""
"""Remove the stored userid from the session."""
if self.userid_key in request.session:
del request.session[self.userid_key]
return []

def authenticated_userid(self, request):
""" Return the stored userid."""
"""Return the stored userid."""
return request.session.get(self.userid_key)


Expand Down Expand Up @@ -1332,7 +1332,7 @@ def __init__(self, check, realm='Realm', debug=False):
self.debug = debug

def unauthenticated_userid(self, request):
""" The userid parsed from the ``Authorization`` request header."""
"""The userid parsed from the ``Authorization`` request header."""
credentials = extract_http_basic_credentials(request)
if credentials:
return credentials.username
Expand Down
4 changes: 2 additions & 2 deletions src/pyramid/config/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def get_resource_filename(self, manager, resource_name):
)

def get_resource_stream(self, manager, resource_name):
""" Return a readable file-like object for resource_name."""
"""Return a readable file-like object for resource_name."""
overrides = self._get_overrides()
if overrides is not None:
stream = overrides.get_stream(resource_name)
Expand All @@ -45,7 +45,7 @@ def get_resource_stream(self, manager, resource_name):
)

def get_resource_string(self, manager, resource_name):
""" Return a string containing the contents of resource_name."""
"""Return a string containing the contents of resource_name."""
overrides = self._get_overrides()
if overrides is not None:
string = overrides.get_string(resource_name)
Expand Down
12 changes: 6 additions & 6 deletions src/pyramid/csrf.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class LegacySessionCSRFStoragePolicy:
"""

def new_csrf_token(self, request):
""" Sets a new CSRF token into the session and returns it. """
"""Sets a new CSRF token into the session and returns it."""
return request.session.new_csrf_token()

def get_csrf_token(self, request):
Expand All @@ -41,7 +41,7 @@ def get_csrf_token(self, request):
return request.session.get_csrf_token()

def check_csrf_token(self, request, supplied_token):
""" Returns ``True`` if the ``supplied_token`` is valid."""
"""Returns ``True`` if the ``supplied_token`` is valid."""
expected_token = self.get_csrf_token(request)
return not strings_differ(
bytes_(expected_token), bytes_(supplied_token)
Expand Down Expand Up @@ -70,7 +70,7 @@ def __init__(self, key='_csrft_'):
self.key = key

def new_csrf_token(self, request):
""" Sets a new CSRF token into the session and returns it. """
"""Sets a new CSRF token into the session and returns it."""
token = self._token_factory()
request.session[self.key] = token
return token
Expand All @@ -84,7 +84,7 @@ def get_csrf_token(self, request):
return token

def check_csrf_token(self, request, supplied_token):
""" Returns ``True`` if the ``supplied_token`` is valid."""
"""Returns ``True`` if the ``supplied_token`` is valid."""
expected_token = self.get_csrf_token(request)
return not strings_differ(
bytes_(expected_token), bytes_(supplied_token)
Expand Down Expand Up @@ -134,7 +134,7 @@ def __init__(
self.cookie_name = cookie_name

def new_csrf_token(self, request):
""" Sets a new CSRF token into the request and returns it. """
"""Sets a new CSRF token into the request and returns it."""
token = self._token_factory()
request.cookies[self.cookie_name] = token

Expand All @@ -154,7 +154,7 @@ def get_csrf_token(self, request):
return token

def check_csrf_token(self, request, supplied_token):
""" Returns ``True`` if the ``supplied_token`` is valid."""
"""Returns ``True`` if the ``supplied_token`` is valid."""
expected_token = self.get_csrf_token(request)
return not strings_differ(
bytes_(expected_token), bytes_(supplied_token)
Expand Down
4 changes: 2 additions & 2 deletions src/pyramid/i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def get_localizer(request):


class Translations(gettext.GNUTranslations):
"""An extended translation catalog class (ripped off from Babel) """
"""An extended translation catalog class (ripped off from Babel)"""

DEFAULT_DOMAIN = 'messages'

Expand Down Expand Up @@ -369,7 +369,7 @@ def dungettext(self, domain, singular, plural, num):
class LocalizerRequestMixin:
@reify
def localizer(self):
""" Convenience property to return a localizer """
"""Convenience property to return a localizer"""
registry = self.registry

current_locale_name = self.locale_name
Expand Down
Loading

0 comments on commit 2efb134

Please sign in to comment.