summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIevgen Popovych <jmennius@gmail.com>2023-11-29 22:22:22 +0200
committerIevgen Popovych <jmennius@gmail.com>2023-11-30 11:48:08 +0200
commit3678b4d5f631e3496adb1f09d799b61c2614f0f9 (patch)
tree9b17c84359664be9fa5208a161c29a631154e91d /src
parent3739a7790ba92c34098df3d804f27a1d8429f9fe (diff)
downloadpyramid-3678b4d5f631e3496adb1f09d799b61c2614f0f9.tar.gz
pyramid-3678b4d5f631e3496adb1f09d799b61c2614f0f9.tar.bz2
pyramid-3678b4d5f631e3496adb1f09d799b61c2614f0f9.zip
Add 3.12 to CI, tox and metadata; use latest black and flake8
Signed-off-by: Ievgen Popovych <jmennius@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/pyramid/config/adapters.py8
-rw-r--r--src/pyramid/config/routes.py2
-rw-r--r--src/pyramid/config/tweens.py1
-rw-r--r--src/pyramid/config/views.py6
-rw-r--r--src/pyramid/encode.py2
-rw-r--r--src/pyramid/interfaces.py2
-rw-r--r--src/pyramid/registry.py1
-rw-r--r--src/pyramid/router.py1
-rw-r--r--src/pyramid/scripts/pserve.py1
-rw-r--r--src/pyramid/traversal.py1
-rw-r--r--src/pyramid/util.py1
11 files changed, 9 insertions, 17 deletions
diff --git a/src/pyramid/config/adapters.py b/src/pyramid/config/adapters.py
index a64c251ca..312dfe1f9 100644
--- a/src/pyramid/config/adapters.py
+++ b/src/pyramid/config/adapters.py
@@ -76,8 +76,6 @@ class AdaptersConfiguratorMixin:
return subscriber
def _derive_predicate(self, predicate):
- derived_predicate = predicate
-
if eventonly(predicate):
def derived_predicate(*arg):
@@ -85,12 +83,12 @@ class AdaptersConfiguratorMixin:
# seems pointless to try to fix __doc__, __module__, etc as
# predicate will invariably be an instance
+ else:
+ derived_predicate = predicate
return derived_predicate
def _derive_subscriber(self, subscriber, predicates):
- derived_subscriber = subscriber
-
if eventonly(subscriber):
def derived_subscriber(*arg):
@@ -98,6 +96,8 @@ class AdaptersConfiguratorMixin:
if hasattr(subscriber, '__name__'):
update_wrapper(derived_subscriber, subscriber)
+ else:
+ derived_subscriber = subscriber
if not predicates:
return derived_subscriber
diff --git a/src/pyramid/config/routes.py b/src/pyramid/config/routes.py
index a7ff66a47..409f36849 100644
--- a/src/pyramid/config/routes.py
+++ b/src/pyramid/config/routes.py
@@ -542,7 +542,7 @@ class RoutesConfiguratorMixin:
def add_default_route_predicates(self):
p = pyramid.predicates
- for (name, factory) in (
+ for name, factory in (
('xhr', p.XHRPredicate),
('request_method', p.RequestMethodPredicate),
('path_info', p.PathInfoPredicate),
diff --git a/src/pyramid/config/tweens.py b/src/pyramid/config/tweens.py
index 0eeac333e..1cf6d9262 100644
--- a/src/pyramid/config/tweens.py
+++ b/src/pyramid/config/tweens.py
@@ -102,7 +102,6 @@ class TweensConfiguratorMixin:
@action_method
def _add_tween(self, tween_factory, under=None, over=None, explicit=False):
-
if not isinstance(tween_factory, str):
raise ConfigurationError(
'The "tween_factory" argument to add_tween must be a '
diff --git a/src/pyramid/config/views.py b/src/pyramid/config/views.py
index 4f5806df3..fababf542 100644
--- a/src/pyramid/config/views.py
+++ b/src/pyramid/config/views.py
@@ -886,7 +886,7 @@ class ViewsConfiguratorMixin:
pvals = {}
dvals = {}
- for (k, v) in ovals.items():
+ for k, v in ovals.items():
if k in valid_predicates:
pvals[k] = v
else:
@@ -1206,7 +1206,7 @@ class ViewsConfiguratorMixin:
def add_default_view_predicates(self):
p = pyramid.predicates
- for (name, factory) in (
+ for name, factory in (
('xhr', p.XHRPredicate),
('request_method', p.RequestMethodPredicate),
('path_info', p.PathInfoPredicate),
@@ -2163,7 +2163,7 @@ class StaticURLInfo:
self.cache_busters = []
def generate(self, path, request, **kw):
- for (url, spec, route_name) in self.registrations:
+ for url, spec, route_name in self.registrations:
if path.startswith(spec):
subpath = path[len(spec) :]
if WIN: # pragma: no cover
diff --git a/src/pyramid/encode.py b/src/pyramid/encode.py
index 153940534..f97af4fa4 100644
--- a/src/pyramid/encode.py
+++ b/src/pyramid/encode.py
@@ -64,7 +64,7 @@ def urlencode(query, doseq=True, quote_via=quote_plus):
result = ''
prefix = ''
- for (k, v) in query:
+ for k, v in query:
k = quote_via(k)
if is_nonstr_iter(v):
diff --git a/src/pyramid/interfaces.py b/src/pyramid/interfaces.py
index 6221cc21e..4ee294189 100644
--- a/src/pyramid/interfaces.py
+++ b/src/pyramid/interfaces.py
@@ -921,7 +921,6 @@ ILogger = IDebugLogger # b/c
class IRoutePregenerator(Interface):
def __call__(request, elements, kw):
-
"""A pregenerator is a function associated by a developer with a
:term:`route`. The pregenerator for a route is called by
:meth:`pyramid.request.Request.route_url` in order to adjust the set
@@ -1384,7 +1383,6 @@ class IIntrospectable(Interface):
""" # noqa: E501
def __hash__():
-
"""Introspectables must be hashable. The typical implementation of
an introsepectable's __hash__ is::
diff --git a/src/pyramid/registry.py b/src/pyramid/registry.py
index 971ae786a..0b983a6c5 100644
--- a/src/pyramid/registry.py
+++ b/src/pyramid/registry.py
@@ -208,7 +208,6 @@ class Introspector:
@implementer(IIntrospectable)
class Introspectable(dict):
-
order = 0 # mutated by introspector.add
action_info = None # mutated by self.register
diff --git a/src/pyramid/router.py b/src/pyramid/router.py
index 61660c41b..0b7554e23 100644
--- a/src/pyramid/router.py
+++ b/src/pyramid/router.py
@@ -28,7 +28,6 @@ from pyramid.view import _call_view
@implementer(IRouter)
class Router:
-
debug_notfound = False
debug_routematch = False
diff --git a/src/pyramid/scripts/pserve.py b/src/pyramid/scripts/pserve.py
index 0c4782ce5..8eb0ca52f 100644
--- a/src/pyramid/scripts/pserve.py
+++ b/src/pyramid/scripts/pserve.py
@@ -31,7 +31,6 @@ def main(argv=sys.argv, quiet=False, original_ignore_files=None):
class PServeCommand:
-
description = """\
This command serves a web application that uses a PasteDeploy
configuration file for the server and application.
diff --git a/src/pyramid/traversal.py b/src/pyramid/traversal.py
index 00b64bae2..986069d1d 100644
--- a/src/pyramid/traversal.py
+++ b/src/pyramid/traversal.py
@@ -597,7 +597,6 @@ class ResourceTreeTraverser:
matchdict = request.matchdict
if matchdict is not None:
-
path = matchdict.get('traverse', '/') or '/'
if is_nonstr_iter(path):
# this is a *traverse stararg (not a {traverse})
diff --git a/src/pyramid/util.py b/src/pyramid/util.py
index 8d384cc84..f396712f3 100644
--- a/src/pyramid/util.py
+++ b/src/pyramid/util.py
@@ -683,7 +683,6 @@ def takes_one_arg(callee, attr=None, argname=None):
return True
if argname:
-
defaults = argspec[3]
if defaults is None:
defaults = ()