From d178653b5f7a5ee2ba15e215ce60caeeb9ed82e1 Mon Sep 17 00:00:00 2001 From: David Lord Date: Fri, 25 Nov 2022 07:39:54 -0800 Subject: [PATCH] update requirements --- .pre-commit-config.yaml | 11 +++++------ requirements/dev.txt | 18 ++++++++++-------- requirements/docs.txt | 10 +++++----- requirements/tests.txt | 8 +------- requirements/typing.txt | 10 ++++------ src/flask/app.py | 4 ++-- src/flask/blueprints.py | 8 ++++---- src/flask/ctx.py | 2 +- src/flask/helpers.py | 6 +++--- src/flask/testing.py | 2 +- src/flask/wrappers.py | 2 +- tests/typing/typing_app_decorators.py | 4 ++-- 12 files changed, 39 insertions(+), 46 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1781bc90..b4ee36a0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,10 +3,10 @@ ci: autoupdate_schedule: monthly repos: - repo: https://github.com/asottile/pyupgrade - rev: v3.2.0 + rev: v3.2.2 hooks: - id: pyupgrade - args: ["--py36-plus"] + args: ["--py37-plus"] - repo: https://github.com/asottile/reorder_python_imports rev: v3.9.0 hooks: @@ -14,24 +14,23 @@ repos: name: Reorder Python imports (src, tests) files: "^(?!examples/)" args: ["--application-directories", "src"] - additional_dependencies: ["setuptools>60.9"] - repo: https://github.com/psf/black rev: 22.10.0 hooks: - id: black - repo: https://github.com/PyCQA/flake8 - rev: 5.0.4 + rev: 6.0.0 hooks: - id: flake8 additional_dependencies: - flake8-bugbear - flake8-implicit-str-concat - repo: https://github.com/peterdemin/pip-compile-multi - rev: v2.5.0 + rev: v2.6.1 hooks: - id: pip-compile-multi-verify - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v4.4.0 hooks: - id: fix-byte-order-marker - id: trailing-whitespace diff --git a/requirements/dev.txt b/requirements/dev.txt index 4796a633..7597d9c9 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -8,7 +8,7 @@ -r docs.txt -r tests.txt -r typing.txt -build==0.8.0 +build==0.9.0 # via pip-tools cfgv==3.3.1 # via pre-commit @@ -22,20 +22,22 @@ filelock==3.8.0 # via # tox # virtualenv -identify==2.5.5 +identify==2.5.9 # via pre-commit nodeenv==1.7.0 # via pre-commit pep517==0.13.0 # via build -pip-compile-multi==2.4.6 +pip-compile-multi==2.6.1 # via -r requirements/dev.in -pip-tools==6.8.0 +pip-tools==6.10.0 # via pip-compile-multi -platformdirs==2.5.2 +platformdirs==2.5.4 # via virtualenv pre-commit==2.20.0 # via -r requirements/dev.in +py==1.11.0 + # via tox pyyaml==6.0 # via pre-commit six==1.16.0 @@ -44,13 +46,13 @@ toml==0.10.2 # via pre-commit toposort==1.7 # via pip-compile-multi -tox==3.26.0 +tox==3.27.1 # via -r requirements/dev.in -virtualenv==20.16.5 +virtualenv==20.16.7 # via # pre-commit # tox -wheel==0.37.1 +wheel==0.38.4 # via pip-tools # The following packages are considered to be unsafe in a requirements file: diff --git a/requirements/docs.txt b/requirements/docs.txt index db4c099a..7c7e5869 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -7,9 +7,9 @@ # alabaster==0.7.12 # via sphinx -babel==2.10.3 +babel==2.11.0 # via sphinx -certifi==2022.6.15.1 +certifi==2022.9.24 # via requests charset-normalizer==2.1.1 # via requests @@ -17,7 +17,7 @@ docutils==0.17.1 # via # sphinx # sphinx-tabs -idna==3.3 +idna==3.4 # via requests imagesize==1.4.1 # via sphinx @@ -37,7 +37,7 @@ pygments==2.13.0 # sphinx-tabs pyparsing==3.0.9 # via packaging -pytz==2022.2.1 +pytz==2022.6 # via babel requests==2.28.1 # via sphinx @@ -68,5 +68,5 @@ sphinxcontrib-qthelp==1.0.3 # via sphinx sphinxcontrib-serializinghtml==1.1.5 # via sphinx -urllib3==1.26.12 +urllib3==1.26.13 # via requests diff --git a/requirements/tests.txt b/requirements/tests.txt index 12929517..b6bc00fc 100644 --- a/requirements/tests.txt +++ b/requirements/tests.txt @@ -11,21 +11,15 @@ attrs==22.1.0 # via pytest blinker==1.5 # via -r requirements/tests.in -greenlet==1.1.3 ; python_version < "3.11" - # via -r requirements/tests.in iniconfig==1.1.1 # via pytest packaging==21.3 # via pytest pluggy==1.0.0 # via pytest -py==1.11.0 - # via pytest pyparsing==3.0.9 # via packaging -pytest==7.1.3 +pytest==7.2.0 # via -r requirements/tests.in python-dotenv==0.21.0 # via -r requirements/tests.in -tomli==2.0.1 - # via pytest diff --git a/requirements/typing.txt b/requirements/typing.txt index 5c15669e..491a09fb 100644 --- a/requirements/typing.txt +++ b/requirements/typing.txt @@ -7,21 +7,19 @@ # cffi==1.15.1 # via cryptography -cryptography==38.0.1 +cryptography==38.0.3 # via -r requirements/typing.in -mypy==0.971 +mypy==0.991 # via -r requirements/typing.in mypy-extensions==0.4.3 # via mypy pycparser==2.21 # via cffi -tomli==2.0.1 - # via mypy types-contextvars==2.4.7 # via -r requirements/typing.in types-dataclasses==0.6.6 # via -r requirements/typing.in -types-setuptools==65.3.0 +types-setuptools==65.6.0.1 # via -r requirements/typing.in -typing-extensions==4.3.0 +typing-extensions==4.4.0 # via mypy diff --git a/src/flask/app.py b/src/flask/app.py index db442c9e..fed76e30 100644 --- a/src/flask/app.py +++ b/src/flask/app.py @@ -384,7 +384,7 @@ class Flask(Scaffold): _json_decoder: t.Union[t.Type[json.JSONDecoder], None] = None @property # type: ignore[override] - def json_encoder(self) -> t.Type[json.JSONEncoder]: # type: ignore[override] + def json_encoder(self) -> t.Type[json.JSONEncoder]: """The JSON encoder class to use. Defaults to :class:`~flask.json.JSONEncoder`. @@ -423,7 +423,7 @@ class Flask(Scaffold): self._json_encoder = value @property # type: ignore[override] - def json_decoder(self) -> t.Type[json.JSONDecoder]: # type: ignore[override] + def json_decoder(self) -> t.Type[json.JSONDecoder]: """The JSON decoder class to use. Defaults to :class:`~flask.json.JSONDecoder`. diff --git a/src/flask/blueprints.py b/src/flask/blueprints.py index 104f8acf..c2595512 100644 --- a/src/flask/blueprints.py +++ b/src/flask/blueprints.py @@ -176,8 +176,8 @@ class Blueprint(Scaffold): _json_encoder: t.Union[t.Type[json.JSONEncoder], None] = None _json_decoder: t.Union[t.Type[json.JSONDecoder], None] = None - @property # type: ignore[override] - def json_encoder( # type: ignore[override] + @property + def json_encoder( self, ) -> t.Union[t.Type[json.JSONEncoder], None]: """Blueprint-local JSON encoder class to use. Set to ``None`` to use the app's. @@ -210,8 +210,8 @@ class Blueprint(Scaffold): ) self._json_encoder = value - @property # type: ignore[override] - def json_decoder( # type: ignore[override] + @property + def json_decoder( self, ) -> t.Union[t.Type[json.JSONDecoder], None]: """Blueprint-local JSON decoder class to use. Set to ``None`` to use the app's. diff --git a/src/flask/ctx.py b/src/flask/ctx.py index ca284494..c79c26dc 100644 --- a/src/flask/ctx.py +++ b/src/flask/ctx.py @@ -307,7 +307,7 @@ class RequestContext: self.app = app if request is None: request = app.request_class(environ) - request.json_module = app.json # type: ignore[misc] + request.json_module = app.json self.request: Request = request self.url_adapter = None try: diff --git a/src/flask/helpers.py b/src/flask/helpers.py index 15990d0e..3833cb8a 100644 --- a/src/flask/helpers.py +++ b/src/flask/helpers.py @@ -149,7 +149,7 @@ def stream_with_context( yield from gen finally: if hasattr(gen, "close"): - gen.close() # type: ignore + gen.close() # The trick is to start the generator. Then the code execution runs until # the first dummy None is yielded at which point the context was already @@ -287,7 +287,7 @@ def redirect( return _wz_redirect(location, code=code, Response=Response) -def abort( # type: ignore[misc] +def abort( code: t.Union[int, "BaseResponse"], *args: t.Any, **kwargs: t.Any ) -> "te.NoReturn": """Raise an :exc:`~werkzeug.exceptions.HTTPException` for the given @@ -617,7 +617,7 @@ def get_root_path(import_name: str) -> str: return os.getcwd() if hasattr(loader, "get_filename"): - filepath = loader.get_filename(import_name) # type: ignore + filepath = loader.get_filename(import_name) else: # Fall back to imports. __import__(import_name) diff --git a/src/flask/testing.py b/src/flask/testing.py index ec9ebb9d..3b21b093 100644 --- a/src/flask/testing.py +++ b/src/flask/testing.py @@ -225,7 +225,7 @@ class FlaskClient(Client): buffered=buffered, follow_redirects=follow_redirects, ) - response.json_module = self.application.json # type: ignore[misc] + response.json_module = self.application.json # type: ignore[assignment] # Re-push contexts that were preserved during the request. while self._new_contexts: diff --git a/src/flask/wrappers.py b/src/flask/wrappers.py index 4b855bfc..e36a72cb 100644 --- a/src/flask/wrappers.py +++ b/src/flask/wrappers.py @@ -25,7 +25,7 @@ class Request(RequestBase): specific ones. """ - json_module = json + json_module: t.Any = json #: The internal URL rule that matched the request. This can be #: useful to inspect which methods are allowed for the URL from diff --git a/tests/typing/typing_app_decorators.py b/tests/typing/typing_app_decorators.py index 3df3e716..6b2188aa 100644 --- a/tests/typing/typing_app_decorators.py +++ b/tests/typing/typing_app_decorators.py @@ -10,12 +10,12 @@ app = Flask(__name__) @app.after_request def after_sync(response: Response) -> Response: - ... + return Response() @app.after_request async def after_async(response: Response) -> Response: - ... + return Response() @app.before_request