Skip to content

Commit e9aa5c2

Browse files
authored
Add support for Python 3.14 (#1340)
2 parents d202a5e + 9560cc4 commit e9aa5c2

File tree

6 files changed

+144
-9
lines changed

6 files changed

+144
-9
lines changed

.github/workflows/test.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ jobs:
4242
- "3.11"
4343
- "3.12"
4444
- "3.13"
45+
- "3.14"
4546
tox-post-environments:
4647
- "py3.8-mindeps"
4748
- "py3.11-sphinxext"
@@ -69,7 +70,7 @@ jobs:
6970
runner: "ubuntu-latest"
7071
cpythons:
7172
- "3.8"
72-
- "3.13"
73+
- "3.14"
7374
tox-environments:
7475
- "check-min-python-is-tested"
7576
- "mypy-py3.13"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Python Support
2+
--------------
3+
4+
- Add support for Python 3.14. (:pr:`NUMBER`)

requirements/py3.14/test.txt

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.14
3+
# by the following command:
4+
#
5+
# tox p -m freezedeps
6+
#
7+
certifi==2025.11.12
8+
# via requests
9+
charset-normalizer==3.4.4
10+
# via requests
11+
coverage==7.11.3
12+
# via -r .test.in
13+
execnet==2.1.2
14+
# via pytest-xdist
15+
flaky==3.8.1
16+
# via -r .test.in
17+
idna==3.11
18+
# via requests
19+
iniconfig==2.3.0
20+
# via pytest
21+
packaging==25.0
22+
# via pytest
23+
pluggy==1.6.0
24+
# via pytest
25+
pygments==2.19.2
26+
# via pytest
27+
pytest==9.0.1
28+
# via
29+
# -r .test.in
30+
# pytest-randomly
31+
# pytest-xdist
32+
pytest-randomly==4.0.1
33+
# via -r .test.in
34+
pytest-xdist==3.8.0
35+
# via -r .test.in
36+
pyyaml==6.0.3
37+
# via responses
38+
requests==2.32.5
39+
# via responses
40+
responses==0.25.8
41+
# via -r .test.in
42+
urllib3==2.5.0
43+
# via
44+
# requests
45+
# responses

requirements/py3.14/typing.txt

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.14
3+
# by the following command:
4+
#
5+
# tox p -m freezedeps
6+
#
7+
alabaster==1.0.0
8+
# via sphinx
9+
babel==2.17.0
10+
# via sphinx
11+
certifi==2025.11.12
12+
# via requests
13+
charset-normalizer==3.4.4
14+
# via requests
15+
docutils==0.21.2
16+
# via sphinx
17+
idna==3.11
18+
# via requests
19+
imagesize==1.4.1
20+
# via sphinx
21+
jinja2==3.1.6
22+
# via sphinx
23+
markupsafe==3.0.3
24+
# via jinja2
25+
mypy==1.18.2
26+
# via -r .typing.in
27+
mypy-extensions==1.1.0
28+
# via mypy
29+
packaging==25.0
30+
# via sphinx
31+
pathspec==0.12.1
32+
# via mypy
33+
pygments==2.19.2
34+
# via sphinx
35+
pyyaml==6.0.3
36+
# via responses
37+
requests==2.32.5
38+
# via
39+
# responses
40+
# sphinx
41+
responses==0.25.8
42+
# via -r .typing.in
43+
roman-numerals-py==3.1.0
44+
# via sphinx
45+
snowballstemmer==3.0.1
46+
# via sphinx
47+
sphinx==8.2.3
48+
# via -r .typing.in
49+
sphinxcontrib-applehelp==2.0.0
50+
# via sphinx
51+
sphinxcontrib-devhelp==2.0.0
52+
# via sphinx
53+
sphinxcontrib-htmlhelp==2.1.0
54+
# via sphinx
55+
sphinxcontrib-jsmath==1.0.1
56+
# via sphinx
57+
sphinxcontrib-qthelp==2.0.0
58+
# via sphinx
59+
sphinxcontrib-serializinghtml==2.0.0
60+
# via sphinx
61+
types-cryptography==3.3.23.2
62+
# via types-jwt
63+
types-docutils==0.22.2.20251006
64+
# via -r .typing.in
65+
types-jwt==0.1.3
66+
# via -r .typing.in
67+
types-requests==2.32.4.20250913
68+
# via -r .typing.in
69+
typing-extensions==4.15.0
70+
# via
71+
# -r .typing.in
72+
# mypy
73+
urllib3==2.5.0
74+
# via
75+
# requests
76+
# responses
77+
# types-requests

tests/unit/helpers/gcs/test_collections.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import inspect
2+
import sys
3+
import types
24
import typing as t
35
import uuid
46

@@ -15,6 +17,11 @@
1517
from globus_sdk._missing import MISSING, MissingType, filter_missing
1618
from globus_sdk.transport import JSONRequestEncoder
1719

20+
if sys.version_info >= (3, 10):
21+
UnionTypes = (t.Union, types.UnionType)
22+
else:
23+
UnionTypes = (t.Union,)
24+
1825
STUB_SG_ID = uuid.uuid1() # storage gateway
1926
STUB_MC_ID = uuid.uuid1() # mapped collection
2027
STUB_UC_ID = uuid.uuid1() # user credential
@@ -307,7 +314,8 @@ def _gen_value(_type):
307314
return ["STRING"]
308315
if _type is bool:
309316
return [True, False]
310-
if _type is t.Union[uuid.UUID, str]:
317+
# Union[UUID, str] | (UUID | str)
318+
if t.get_origin(_type) in UnionTypes and set(t.get_args(_type)) == {uuid.UUID, str}:
311319
return [str(uuid.uuid1()), uuid.uuid1()]
312320
if _type is t.Iterable[str]:
313321
return [[], ["a", "b", "c"]]

tox.ini

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ envlist =
55
pylint
66
test-lazy-imports
77
coverage_clean
8-
py{3.13,3.12,3.11,3.10,3.9,3.8}
8+
py{3.14,3.13,3.12,3.11,3.10,3.9,3.8}
99
py3.8-mindeps
1010
py3.11-sphinxext
1111
coverage_report
1212
docs
1313
minversion = 4.22.0
1414
labels =
15-
freezedeps = freezedeps-print,freezedeps-py{3.13,3.12,3.11,3.10,3.9,3.8}
15+
freezedeps = freezedeps-print,freezedeps-py{3.14,3.13,3.12,3.11,3.10,3.9,3.8}
1616

1717
[testenv]
1818
# build a wheel, not a tarball, and use a common env to do it (so that the wheel is shared)
@@ -25,8 +25,8 @@ deps =
2525
sphinxext: -r requirements/py{py_dot_ver}/docs.txt
2626
commands = coverage run -m pytest {posargs}
2727
depends =
28-
py{3.13,3.12,3.11,3.10,3.9,3.8}{-mindeps,-sphinxext,}: coverage_clean, lint
29-
coverage_report: py{3.13,3.12,3.11,3.10,3.9,3.8}{-mindeps,-sphinxext,}
28+
py{3.14,3.13,3.12,3.11,3.10,3.9,3.8}{-mindeps,-sphinxext,}: coverage_clean, lint
29+
coverage_report: py{3.14,3.13,3.12,3.11,3.10,3.9,3.8}{-mindeps,-sphinxext,}
3030

3131
[testenv:coverage_clean]
3232
dependency_groups = coverage
@@ -44,7 +44,7 @@ deps = pre-commit
4444
skip_install = true
4545
commands = pre-commit run --all-files
4646

47-
[testenv:mypy,mypy-{py3.8,py3.13}]
47+
[testenv:mypy,mypy-{py3.8,py3.14}]
4848
deps = -r requirements/py{py_dot_ver}/typing.txt
4949
commands = mypy src/ {posargs}
5050

@@ -64,7 +64,7 @@ deps =
6464
pytest-benchmark
6565
commands = pytest tests/benchmark/ {posargs}
6666

67-
[testenv:pylint,pylint-{py3.8,py3.9,py3.10,py3.11,py3.12,py3.13}]
67+
[testenv:pylint,pylint-{py3.8,py3.9,py3.10,py3.11,py3.12,py3.13,py3.14}]
6868
deps = pylint
6969
commands = pylint {posargs:src/}
7070

@@ -109,7 +109,7 @@ commands =
109109
python -m dependency_groups typing -o requirements/.typing.in
110110
python -m dependency_groups test-mindeps -o requirements/.test-mindeps.in
111111
python -m dependency_groups docs -o requirements/.docs.in
112-
[testenv:freezedeps-py{3.13,3.12,3.11,3.10,3.9,3.8}]
112+
[testenv:freezedeps-py{3.14,3.13,3.12,3.11,3.10,3.9,3.8}]
113113
description = freeze development dependencies using pip-compile
114114
skip_install = true
115115
setenv =

0 commit comments

Comments
 (0)