From 6e573b0713e0d31a3ebb6a69ea9540bd42b9aa80 Mon Sep 17 00:00:00 2001 From: Kurt McKee Date: Thu, 19 Sep 2024 15:34:16 -0500 Subject: [PATCH] Support Python 3.13 Fixes #1056 --- .github/workflows/build.yaml | 2 +- .../20240919_153350_kurtmckee_python_3_13.rst | 4 ++ pyproject.toml | 1 + requirements/py3.13/test.txt | 43 +++++++++++++++++++ requirements/py3.13/typing.txt | 39 +++++++++++++++++ .../globus_app/test_globus_app.py | 2 + tests/unit/test_tokenstorage.py | 5 ++- tox.ini | 10 ++--- 8 files changed, 99 insertions(+), 7 deletions(-) create mode 100644 changelog.d/20240919_153350_kurtmckee_python_3_13.rst create mode 100644 requirements/py3.13/test.txt create mode 100644 requirements/py3.13/typing.txt diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 563b73772..0f6a87020 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -31,7 +31,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] # we do not want a large number of windows and macos builds, so # enumerate them explicitly include: diff --git a/changelog.d/20240919_153350_kurtmckee_python_3_13.rst b/changelog.d/20240919_153350_kurtmckee_python_3_13.rst new file mode 100644 index 000000000..54e843088 --- /dev/null +++ b/changelog.d/20240919_153350_kurtmckee_python_3_13.rst @@ -0,0 +1,4 @@ +Python Support +~~~~~~~~~~~~~~ + +- Support Python 3.13. (:pr:`NUMBER`) diff --git a/pyproject.toml b/pyproject.toml index 10d329928..5ad75868f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,6 +19,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", ] requires-python = ">=3.8" dependencies = [ diff --git a/requirements/py3.13/test.txt b/requirements/py3.13/test.txt new file mode 100644 index 000000000..3f9a4f87e --- /dev/null +++ b/requirements/py3.13/test.txt @@ -0,0 +1,43 @@ +# +# This file is autogenerated by pip-compile with Python 3.13 +# by the following command: +# +# tox p -m freezedeps +# +certifi==2024.8.30 + # via requests +charset-normalizer==3.3.2 + # via requests +coverage==7.6.1 + # via -r test.in +execnet==2.1.1 + # via pytest-xdist +flaky==3.8.1 + # via -r test.in +idna==3.10 + # via requests +iniconfig==2.0.0 + # via pytest +packaging==24.1 + # via pytest +pluggy==1.5.0 + # via pytest +pytest==8.3.3 + # via + # -r test.in + # pytest-randomly + # pytest-xdist +pytest-randomly==3.15.0 + # via -r test.in +pytest-xdist==3.6.1 + # via -r test.in +pyyaml==6.0.2 + # via responses +requests==2.32.3 + # via responses +responses==0.25.3 + # via -r test.in +urllib3==2.2.3 + # via + # requests + # responses diff --git a/requirements/py3.13/typing.txt b/requirements/py3.13/typing.txt new file mode 100644 index 000000000..60c21bc93 --- /dev/null +++ b/requirements/py3.13/typing.txt @@ -0,0 +1,39 @@ +# +# This file is autogenerated by pip-compile with Python 3.13 +# by the following command: +# +# tox p -m freezedeps +# +certifi==2024.8.30 + # via requests +charset-normalizer==3.3.2 + # via requests +idna==3.10 + # via requests +mypy==1.11.2 + # via -r typing.in +mypy-extensions==1.0.0 + # via mypy +pyyaml==6.0.2 + # via responses +requests==2.32.3 + # via responses +responses==0.25.3 + # via -r typing.in +types-cryptography==3.3.23.2 + # via types-jwt +types-docutils==0.21.0.20240907 + # via -r typing.in +types-jwt==0.1.3 + # via -r typing.in +types-requests==2.32.0.20240914 + # via -r typing.in +typing-extensions==4.12.2 + # via + # -r typing.in + # mypy +urllib3==2.2.3 + # via + # requests + # responses + # types-requests diff --git a/tests/unit/experimental/globus_app/test_globus_app.py b/tests/unit/experimental/globus_app/test_globus_app.py index 968b1ec58..da9ab0465 100644 --- a/tests/unit/experimental/globus_app/test_globus_app.py +++ b/tests/unit/experimental/globus_app/test_globus_app.py @@ -152,6 +152,8 @@ def test_user_app_token_storage_configuration(token_storage_value, token_storage config = GlobusAppConfig(token_storage=token_storage_value) user_app = UserApp("test-app", client_id=client_id, config=config) + if hasattr(user_app._token_storage, "close"): + user_app._token_storage.close() # Prevent a ResourceWarning on Python 3.13 assert isinstance(user_app._token_storage, token_storage_class) diff --git a/tests/unit/test_tokenstorage.py b/tests/unit/test_tokenstorage.py index a80be6baf..bd26475b6 100644 --- a/tests/unit/test_tokenstorage.py +++ b/tests/unit/test_tokenstorage.py @@ -16,6 +16,7 @@ def test_sqlite_reading_bad_config(): with pytest.raises(ValueError, match="reading config data and got non-dict result"): adapter.read_config("foo_conf") + adapter.close() def test_sqlite_reading_bad_token_data(): @@ -31,13 +32,15 @@ def test_sqlite_reading_bad_token_data(): ValueError, match="data error: token data was not saved as a dict" ): adapter.get_token_data("foo_rs") + adapter.close() def test_sqliteadapter_passes_connect_params(): with pytest.raises(TypeError): SQLiteAdapter(":memory:", connect_params={"invalid_kwarg": True}) - SQLiteAdapter(":memory:", connect_params={"timeout": 10}) + adapter = SQLiteAdapter(":memory:", connect_params={"timeout": 10}) + adapter.close() def test_simplejson_reading_bad_data(tmp_path): diff --git a/tox.ini b/tox.ini index fc8ad9e3a..8e8d86be9 100644 --- a/tox.ini +++ b/tox.ini @@ -5,14 +5,14 @@ envlist = pylint test-lazy-imports coverage_clean - py{312,311,310,39,38} + py{313,312,311,310,39,38} py38-mindeps coverage_report docs skip_missing_interpreters = true minversion = 4.0.0 labels = - freezedeps = freezedeps-py{312,311,310,39,38} + freezedeps = freezedeps-py{313,312,311,310,39,38} [testenv] # build a wheel, not a tarball, and use a common env to do it (so that the wheel is shared) @@ -24,8 +24,8 @@ deps = mindeps: -r requirements/py{py_dot_ver}/test-mindeps.txt commands = coverage run -m pytest {posargs} depends = - py{312,311,310,39,38}{-mindeps,}: coverage_clean, lint - coverage_report: py{312,311,310,39,38}{-mindeps,} + py{313,312,311,310,39,38}{-mindeps,}: coverage_clean, lint + coverage_report: py{313,312,311,310,39,38}{-mindeps,} [testenv:coverage_clean] deps = coverage @@ -96,7 +96,7 @@ commands_pre = rm -rf dist/ changedir = tests/non-pytest/poetry-lock-test commands = poetry lock -[testenv:freezedeps-py{312,311,310,39,38}] +[testenv:freezedeps-py{313,312,311,310,39,38}] description = freeze development dependencies using pip-compile skip_install = true setenv =