From d51b04f8e012844382b8e4033e8bc9972be91c61 Mon Sep 17 00:00:00 2001 From: Andreas Maier Date: Sun, 5 May 2024 13:42:08 +0200 Subject: [PATCH] Added support for Python 3.12 Signed-off-by: Andreas Maier --- .github/workflows/test.yml | 8 ++++---- dev-requirements.txt | 12 ++++++++---- docs/changes.rst | 2 ++ minimum-constraints.txt | 39 ++++++++++++++++++++++++-------------- test-requirements.txt | 3 ++- 5 files changed, 41 insertions(+), 23 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8f4d364..c958b60 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,7 +29,7 @@ jobs: if [[ "${{ github.event_name }}" == "schedule" || "${{ github.head_ref }}" =~ ^release_ ]]; then \ echo "matrix={ \ \"os\": [ \"ubuntu-latest\", \"macos-latest\", \"windows-latest\" ], \ - \"python-version\": [ \"3.6\", \"3.7\", \"3.8\", \"3.9\", \"3.10\", \"3.11\" ], \ + \"python-version\": [ \"3.6\", \"3.7\", \"3.8\", \"3.9\", \"3.10\", \"3.11\", \"3.12\" ], \ \"package_level\": [ \"minimum\", \"latest\" ], \ \"exclude\": [ \ { \ @@ -99,7 +99,7 @@ jobs: else \ echo "matrix={ \ \"os\": [ \"ubuntu-latest\" ], \ - \"python-version\": [ \"3.7\", \"3.11\" ], \ + \"python-version\": [ \"3.7\", \"3.12\" ], \ \"package_level\": [ \"minimum\", \"latest\" ], \ \"include\": [ \ { \ @@ -129,7 +129,7 @@ jobs: }, \ { \ \"os\": \"macos-latest\", \ - \"python-version\": \"3.11\", \ + \"python-version\": \"3.12\", \ \"package_level\": \"latest\" \ }, \ { \ @@ -139,7 +139,7 @@ jobs: }, \ { \ \"os\": \"windows-latest\", \ - \"python-version\": \"3.11\", \ + \"python-version\": \"3.12\", \ \"package_level\": \"latest\" \ } \ ] \ diff --git a/dev-requirements.txt b/dev-requirements.txt index 53c161d..927963e 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -76,9 +76,11 @@ Babel>=2.9.1 # Pylint 2.15 / astroid 2.12 is needed to circumvent issue https://github.com/PyCQA/pylint/issues/7972 on Python 3.11 # Pylint 2.14 / astroid 2.11 dropped support for py36 pylint>=2.13.0; python_version <= '3.6' -pylint>=2.15.0; python_version >= '3.7' +pylint>=2.15.0; python_version >= '3.7' and python_version <= '3.11' +pylint>=3.0.3; python_version >= '3.12' astroid>=2.11.0; python_version <= '3.6' -astroid>=2.12.4; python_version >= '3.7' +astroid>=2.12.4; python_version >= '3.7' and python_version <= '3.11' +astroid>=3.0.2; python_version >= '3.12' # astroid 2.13.0 uses typing-extensions on Python<3.11 but misses to require it on 3.10. See https://github.com/PyCQA/astroid/issues/1942 typing-extensions>=3.10; python_version <= '3.10' # typed-ast is used by astroid on py34..py37 @@ -97,7 +99,8 @@ tomlkit>=0.10.1 dill>=0.3.4; python_version <= '3.6' dill>=0.3.6; python_version >= '3.7' # platformdirs is used by pylint starting with its 2.10 -platformdirs>=2.2.0 +platformdirs>=2.2.0; python_version <= '3.11' +platformdirs>=3.2.0; python_version >= '3.12' # Mypy (no imports, invoked via mypy script) # Mypy 0.981 removed support for py36 @@ -126,7 +129,8 @@ pipdeptree>=2.2.0 # pip-check-reqs 2.4.3 fixes a speed issue on Python 3.11. # pip-check-reqs 2.5.0 has issue https://github.com/r1chardj0n3s/pip-check-reqs/issues/143 pip-check-reqs>=2.3.2; python_version >= '3.6' and python_version <= '3.7' -pip-check-reqs>=2.4.3,!=2.5.0; python_version >= '3.8' +pip-check-reqs>=2.4.3,!=2.5.0; python_version >= '3.8' and python_version <= '3.11' +pip-check-reqs>=2.5.1; python_version >= '3.12' # Indirect dependencies with special constraints: diff --git a/docs/changes.rst b/docs/changes.rst index ee85104..7679420 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -44,6 +44,8 @@ Released: not yet **Enhancements:** +* Test: Added support for Python 3.12. (issue #178) + * Improvements for safety check tool: Made passing the safety check mandatory; Fixed safety issues; Separated the safety check into a separate make target; Added a safety policy file. diff --git a/minimum-constraints.txt b/minimum-constraints.txt index 179557b..63b7fec 100644 --- a/minimum-constraints.txt +++ b/minimum-constraints.txt @@ -18,7 +18,8 @@ pip==23.3; python_version >= '3.7' # setuptools 59.7.0 removed support for py36 setuptools==59.6.0; python_version == '3.6' -setuptools==65.5.1; python_version >= '3.7' +setuptools==65.5.1; python_version >= '3.7' and python_version <= '3.11' +setuptools==66.1.0; python_version >= '3.12' wheel==0.33.5; python_version == '3.6' wheel==0.38.1; python_version >= '3.7' @@ -43,8 +44,8 @@ pytest==7.0.0 # Install test direct dependencies: # virtualenv -virtualenv==20.1.0 - +virtualenv==20.1.0; python_version <= '3.11' +virtualenv==20.23.0; python_version >= '3.12' # Indirect dependencies for test (must be consistent with test-requirements.txt, if present) @@ -58,13 +59,15 @@ pluggy==0.13.1 # six (used by virtualenv, tox, probably others) # virtualenv 20.0 requires six>=1.12.0 on py>=3.8 # tox 3.17 requires six>=1.14.0 -six==1.14.0 +six==1.14.0; python_version <= '3.9' +six==1.16.0; python_version >= '3.10' # Indirect dependencies that must be handled early (must be consistent with dev-requirements.txt) # tox and flake8 have requirements on importlib-metadata -importlib-metadata==1.1.0; python_version <= '3.7' +importlib-metadata==2.1.3; python_version <= '3.6' +importlib-metadata==4.8.3; python_version >= '3.7' # Direct dependencies for development (must be consistent with dev-requirements.txt) @@ -112,9 +115,11 @@ Babel==2.9.1 # PyLint (no imports, invoked via pylint script) - does not support py3: pylint==2.13.0; python_version <= '3.6' -pylint==2.15.0; python_version >= '3.7' +pylint==2.15.0; python_version >= '3.7' and python_version <= '3.11' +pylint==3.0.3; python_version >= '3.12' astroid==2.11.0; python_version <= '3.6' -astroid==2.12.4; python_version >= '3.7' +astroid==2.12.4; python_version >= '3.7' and python_version <= '3.11' +astroid==3.0.2; python_version >= '3.12' typing-extensions==3.10; python_version <= '3.10' typed-ast==1.4.0; python_version <= '3.7' and implementation_name=='cpython' lazy-object-proxy==1.4.3 @@ -122,8 +127,11 @@ wrapt==1.14 isort==4.3.8 tomlkit==0.10.1 dill==0.3.4; python_version <= '3.6' -dill==0.3.6; python_version >= '3.7' -platformdirs==2.2.0 +dill==0.3.6; python_version >= '3.7' and python_version <= '3.10' +dill==0.3.7; python_version >= '3.11' + +platformdirs==2.2.0; python_version <= '3.11' +platformdirs==3.2.0; python_version >= '3.12' # Mypy (no imports, invoked via mypy script) mypy==0.971 @@ -142,8 +150,8 @@ readme-renderer==23.0 # Package dependency management tools pipdeptree==2.2.0 pip-check-reqs==2.3.2; python_version >= '3.6' and python_version <= '3.7' -pip-check-reqs==2.4.3; python_version >= '3.8' - +pip-check-reqs==2.4.3; python_version >= '3.8' and python_version <= '3.11' +pip-check-reqs==2.5.1; python_version >= '3.12' # Indirect dependencies with special constraints: @@ -163,9 +171,11 @@ Authlib==1.2.0 bleach==3.3.0 certifi==2023.07.22 chardet==3.0.3 -distlib==0.3.1 +distlib==0.3.1; python_version <= '3.11' +distlib==0.3.7; python_version >= '3.12' docopt==0.6.1 -filelock==3.0.0 +filelock==3.0.0; python_version <= '3.11' +filelock==3.11.0; python_version >= "3.12" gitdb==4.0.1 idna==2.5 imagesize==0.7.1 @@ -179,7 +189,8 @@ py==1.11.0 pydantic==1.10.13 pyparsing==2.4.7 python-dateutil==2.6.0 -pyzmq==16.0.4 +pyzmq==16.0.4; python_version <= '3.11' +pyzmq==25.1.1; python_version >= '3.12' qtconsole==4.2.1 requests==2.25.0; python_version == '3.6' requests==2.31.0; python_version >= '3.7' diff --git a/test-requirements.txt b/test-requirements.txt index 2347d27..44c5658 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -17,7 +17,8 @@ pytest>=7.0.0 # virtualenv # tox 3.21.0 requires virtualenv!=20.0.[0-7],>=16.0.0 and requires py>=3.5 -virtualenv>=20.1.0 +virtualenv>=20.1.0; python_version <= '3.11' +virtualenv>=20.23.0; python_version >= '3.12' # Indirect dependencies with special constraints: