From 32d2f47ed1bf3f27fd46e1a54dd136688de9ab81 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 6 Jun 2023 04:21:31 +0000 Subject: [PATCH 1/5] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - https://github.com/asottile/reorder_python_imports → https://github.com/asottile/reorder-python-imports --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 22110a83..84d93cb1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,7 +7,7 @@ repos: hooks: - id: pyupgrade args: ["--py38-plus"] - - repo: https://github.com/asottile/reorder_python_imports + - repo: https://github.com/asottile/reorder-python-imports rev: v3.9.0 hooks: - id: reorder-python-imports From d614d6bf8c7b6db6f817648836f9044b13dc42b4 Mon Sep 17 00:00:00 2001 From: David Lord Date: Tue, 6 Jun 2023 09:30:34 -0700 Subject: [PATCH 2/5] ignore pytest ast warnings --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 1fae1bcb..c0c7133f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,8 +54,8 @@ version = {attr = "flask.__version__"} testpaths = ["tests"] filterwarnings = [ "error", - # change in Python 3.12 alpha causes warning from inside pytest - "ignore:onerror argument:DeprecationWarning", + # change in Python 3.12 causes warning from inside pytest + "ignore:ast:DeprecationWarning", ] [tool.coverage.run] From 367e1df785a71e9004d9a87a221652bfc5a964ac Mon Sep 17 00:00:00 2001 From: David Lord Date: Wed, 7 Jun 2023 13:10:39 -0700 Subject: [PATCH 3/5] start version 2.3.3 --- CHANGES.rst | 6 ++++++ src/flask/__init__.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 4d651204..32ddd151 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,9 @@ +Version 2.3.3 +------------- + +Unreleased + + Version 2.3.2 ------------- diff --git a/src/flask/__init__.py b/src/flask/__init__.py index 0bef2213..dfe2a0aa 100644 --- a/src/flask/__init__.py +++ b/src/flask/__init__.py @@ -38,7 +38,7 @@ from .templating import render_template_string as render_template_string from .templating import stream_template as stream_template from .templating import stream_template_string as stream_template_string -__version__ = "2.3.2" +__version__ = "2.3.3.dev" def __getattr__(name): From 84e11a1e827c0f55f9b9ee15952eddcf8a6492e0 Mon Sep 17 00:00:00 2001 From: David Lord Date: Wed, 7 Jun 2023 13:07:41 -0700 Subject: [PATCH 4/5] use importlib instead of pkgutil --- CHANGES.rst | 2 ++ src/flask/helpers.py | 5 +++-- src/flask/scaffold.py | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 32ddd151..80652305 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -3,6 +3,8 @@ Version 2.3.3 Unreleased +- Python 3.12 compatibility. + Version 2.3.2 ------------- diff --git a/src/flask/helpers.py b/src/flask/helpers.py index 61a0f818..4e8bc8b8 100644 --- a/src/flask/helpers.py +++ b/src/flask/helpers.py @@ -1,7 +1,7 @@ from __future__ import annotations +import importlib.util import os -import pkgutil import socket import sys import typing as t @@ -575,7 +575,8 @@ def get_root_path(import_name: str) -> str: return os.path.dirname(os.path.abspath(mod.__file__)) # Next attempt: check the loader. - loader = pkgutil.get_loader(import_name) + spec = importlib.util.find_spec(import_name) + loader = spec.loader if spec is not None else None # Loader does not exist or we're referring to an unloaded main # module or a main module without path (interactive sessions), go diff --git a/src/flask/scaffold.py b/src/flask/scaffold.py index 9d3498fc..3c23ef97 100644 --- a/src/flask/scaffold.py +++ b/src/flask/scaffold.py @@ -3,7 +3,6 @@ from __future__ import annotations import importlib.util import os import pathlib -import pkgutil import sys import typing as t from collections import defaultdict @@ -856,7 +855,8 @@ def _find_package_path(import_name): return os.path.dirname(root_spec.origin) # we were unable to find the `package_path` using PEP 451 loaders - loader = pkgutil.get_loader(root_mod_name) + spec = importlib.util.find_spec(root_mod_name) + loader = spec.loader if spec is not None else None if loader is None or root_mod_name == "__main__": # import name is not found, or interactive/main module From ed8ddb6a3a14ae332823b0a266b02a5ef024cbb3 Mon Sep 17 00:00:00 2001 From: David Lord Date: Wed, 7 Jun 2023 13:09:07 -0700 Subject: [PATCH 5/5] update werkzeug to 2.3.5 --- CHANGES.rst | 1 + pyproject.toml | 2 +- requirements/tests-pallets-min.in | 2 +- requirements/tests-pallets-min.txt | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 80652305..b36e1b60 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,6 +4,7 @@ Version 2.3.3 Unreleased - Python 3.12 compatibility. +- Update Werkzeug requirement to >=2.3.5. Version 2.3.2 diff --git a/pyproject.toml b/pyproject.toml index c0c7133f..24de15dd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,7 @@ classifiers = [ ] requires-python = ">=3.8" dependencies = [ - "Werkzeug>=2.3.3", + "Werkzeug>=2.3.5", "Jinja2>=3.1.2", "itsdangerous>=2.1.2", "click>=8.1.3", diff --git a/requirements/tests-pallets-min.in b/requirements/tests-pallets-min.in index 5b2a6ff7..140b6bd1 100644 --- a/requirements/tests-pallets-min.in +++ b/requirements/tests-pallets-min.in @@ -1,4 +1,4 @@ -Werkzeug==2.3.3 +Werkzeug==2.3.5 Jinja2==3.1.2 MarkupSafe==2.1.1 itsdangerous==2.1.2 diff --git a/requirements/tests-pallets-min.txt b/requirements/tests-pallets-min.txt index 1a79a37b..14adc43a 100644 --- a/requirements/tests-pallets-min.txt +++ b/requirements/tests-pallets-min.txt @@ -1,4 +1,4 @@ -# SHA1:0b58503b99aabc227b7f39357216d676d9987a12 +# SHA1:c4bfd085a9d4e81c583daf70671803d5e388c656 # # This file is autogenerated by pip-compile-multi # To update, run: @@ -18,5 +18,5 @@ markupsafe==2.1.1 # -r requirements/tests-pallets-min.in # jinja2 # werkzeug -werkzeug==2.3.3 +werkzeug==2.3.5 # via -r requirements/tests-pallets-min.in