Skip to content

Commit

Permalink
Support Python 3.13
Browse files Browse the repository at this point in the history
Fixes #1056
  • Loading branch information
kurtmckee committed Sep 20, 2024
1 parent 22701f0 commit 6e573b0
Show file tree
Hide file tree
Showing 8 changed files with 99 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions changelog.d/20240919_153350_kurtmckee_python_3_13.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Python Support
~~~~~~~~~~~~~~

- Support Python 3.13. (:pr:`NUMBER`)
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
43 changes: 43 additions & 0 deletions requirements/py3.13/test.txt
Original file line number Diff line number Diff line change
@@ -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
39 changes: 39 additions & 0 deletions requirements/py3.13/typing.txt
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions tests/unit/experimental/globus_app/test_globus_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
5 changes: 4 additions & 1 deletion tests/unit/test_tokenstorage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand All @@ -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):
Expand Down
10 changes: 5 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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 =
Expand Down

0 comments on commit 6e573b0

Please sign in to comment.