Skip to content

Commit 5687321

Browse files
Merge pull request #567 from Backblaze/python3.14
Add explicit python 3.14 support
2 parents 59dbcc0 + bea8276 commit 5687321

9 files changed

Lines changed: 41 additions & 32 deletions

File tree

.github/workflows/cd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
tags: ['v*'] # push events to matching v*, i.e. v1.0, v20.15.10
66

77
env:
8-
PYTHON_DEFAULT_VERSION: "3.12"
8+
PYTHON_DEFAULT_VERSION: "3.14"
99
UV_VERSION: "0.8.24"
1010

1111
jobs:

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
branches: [master]
88

99
env:
10-
PYTHON_DEFAULT_VERSION: "3.12"
10+
PYTHON_DEFAULT_VERSION: "3.14"
1111
UV_VERSION: "0.8.24"
1212

1313
jobs:
@@ -99,7 +99,7 @@ jobs:
9999
fail-fast: false
100100
matrix:
101101
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
102-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "pypy3.9", "pypy3.10"]
102+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "pypy3.9", "pypy3.10"]
103103
extras: [ "" ]
104104
exclude:
105105
- os: "macos-latest"

CONTRIBUTING.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ In order to make it easier to contribute, core developers of this project:
1414
* maintain Continuous Integration (by using GitHub Actions) that:
1515
* runs all sorts of linters
1616
* checks if the Python distribution can be built
17-
* runs all tests on a matrix of 6 versions of Python (including pypy) and 3 operating systems
17+
* runs all tests on a matrix of 8 versions of Python (including pypy) and 3 operating systems
1818
(Linux, Mac OS X and Windows)
1919
* checks if the documentation can be built properly
2020
* maintain other Continuous Integration tools (coverage tracker)
@@ -63,7 +63,7 @@ With `nox`, you can run different sessions (default are `lint` and `test`):
6363

6464
* `format` -> Format the code.
6565
* `lint` -> Run linters.
66-
* `test` (`test-3.7`, `test-3.8`, `test-3.9`, `test-3.10`) -> Run test suite.
66+
* `test` (`test-3.9`, `test-3.10`, `test-3.11`, `test-3.12`, `test-3.13`, `test-3.14`, `test-pypy3.9`, `test-pypy3.10`) -> Run test suite.
6767
* `cover` -> Perform coverage analysis.
6868
* `build` -> Build the distribution.
6969
* `doc` -> Build the documentation.
@@ -73,7 +73,7 @@ For example:
7373

7474
$ nox -s format
7575
nox > Running session format
76-
nox > Creating virtual environment (virtualenv) using python3.10 in .nox/format
76+
nox > Creating virtual environment (virtualenv) using python3.14 in .nox/format
7777
...
7878

7979
$ nox -s format
@@ -85,15 +85,15 @@ For example:
8585
nox > Running session format
8686
...
8787

88-
Sessions `test` ,`unit`, and `integration` can run on many Python versions, 3.7-3.10 by default.
88+
Sessions `test` ,`unit`, and `integration` can run on many Python versions, 3.9-3.14 (+ pypy3.9 and pypy3.10) by default.
8989

90-
Sessions other than `test` use the last given Python version, 3.10 by default.
90+
Sessions other than `test` use the last CPython version from `NOX_PYTHONS`, 3.14 by default.
9191

9292
You can change it:
9393

94-
export NOX_PYTHONS=3.7,3.8
94+
export NOX_PYTHONS=3.12,3.14
9595

96-
With the above setting, session `test` will run on Python 3.7 and 3.8, and all other sessions on Python 3.8.
96+
With the above setting, session `test` will run on Python 3.12 and 3.14, and all other sessions on Python 3.14.
9797

9898
Given Python interpreters should be installed in the operating system or via [pyenv](https://github.com/pyenv/pyenv).
9999

changelog.d/+python314.added.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Declare official support for Python 3.14 and include it in the CI test matrix.

doc/source/conf.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,4 +210,6 @@
210210
]
211211

212212
# Example configuration for intersphinx: refer to the Python standard library.
213-
intersphinx_mapping = {'https://docs.python.org/': None}
213+
intersphinx_mapping = {'python': ('https://docs.python.org/', None)}
214+
215+
coverage_statistics_to_report = False

doc/source/contributing.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@ We encourage outside contributors to perform changes on our codebase. Many such
2020

2121
* runs all sorts of linters
2222
* checks if the Python distribution can be built
23-
* runs all tests on a matrix of 6 versions of Python (including pypy) and 3 operating systems (Linux, Mac OS X and Windows)
23+
* runs all tests on a matrix of 8 versions of Python (including pypy) and 3 operating systems (Linux, Mac OS X and Windows)
2424
* checks if the documentation can be built properly
2525

2626
* maintain other Continuous Integration tools (coverage tracker)
2727

28-
You'll need to have `nox <https://github.com/theacodes/nox>`_ installed:
28+
You'll need to have `nox <https://github.com/theacodes/nox>`_ and `uv <https://docs.astral.sh/uv/>`_ installed:
2929

30-
* ``pip install nox``
30+
* ``pip install nox uv``
3131

3232
With ``nox``, you can run different sessions (default are ``lint`` and ``test``):
3333

3434
* ``format`` -> Format the code.
3535
* ``lint`` -> Run linters.
36-
* ``test`` (``test-3.7``, ``test-3.8``, ``test-3.9``, ``test-3.10``) -> Run test suite.
36+
* ``test`` (``test-3.9``, ``test-3.10``, ``test-3.11``, ``test-3.12``, ``test-3.13``, ``test-3.14``, ``test-pypy3.9``, ``test-pypy3.10``) -> Run test suite.
3737
* ``cover`` -> Perform coverage analysis.
3838
* ``build`` -> Build the distribution.
3939
* ``deploy`` -> Deploy the distribution to the PyPi.
@@ -44,7 +44,7 @@ For example::
4444

4545
$ nox -s format
4646
nox > Running session format
47-
nox > Creating virtual environment (virtualenv) using python3.10 in .nox/format
47+
nox > Creating virtual environment (virtualenv) using python3.14 in .nox/format
4848
...
4949

5050
$ nox -s format
@@ -56,15 +56,15 @@ For example::
5656
nox > Running session format
5757
...
5858

59-
Sessions ``test``, ``unit``, and ``integration`` can run on many Python versions, 3.7-3.10 by default.
59+
Sessions ``test``, ``unit``, and ``integration`` can run on many Python versions, 3.9-3.14 (+ pypy3.9 and pypy3.10) by default.
6060

61-
Sessions other than ``test`` use the last given Python version, 3.10 by default.
61+
Sessions other than ``test`` use the last CPython version from ``NOX_PYTHONS``, 3.14 by default.
6262

6363
You can change it::
6464

65-
export NOX_PYTHONS=3.7,3.8
65+
export NOX_PYTHONS=3.12,3.14
6666

67-
With the above setting, session ``test`` will run on Python 3.7 and 3.8, and all other sessions on Python 3.8.
67+
With the above setting, session ``test`` will run on Python 3.12 and 3.14, and all other sessions on Python 3.14.
6868

6969
Given Python interpreters should be installed in the operating system or via `pyenv <https://github.com/pyenv/pyenv>`_.
7070

noxfile.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
'3.11',
3434
'3.12',
3535
'3.13',
36+
'3.14',
3637
]
3738
if NOX_PYTHONS is None
3839
else NOX_PYTHONS.split(',')
@@ -52,12 +53,15 @@ def _detect_python_nox_id() -> str:
5253
PYTHON_VERSIONS = [_detect_python_nox_id()]
5354
print(f'CI job mode; using provided interpreter only; PYTHON_VERSIONS={PYTHON_VERSIONS!r}')
5455

55-
PYTHON_DEFAULT_VERSION = PYTHON_VERSIONS[-2] if len(PYTHON_VERSIONS) > 1 else PYTHON_VERSIONS[0]
56+
PYTHON_DEFAULT_VERSION = next(
57+
(version for version in reversed(PYTHON_VERSIONS) if not version.lower().startswith('pypy')),
58+
PYTHON_VERSIONS[-1],
59+
)
5660

5761
PY_PATHS = ['b2sdk', 'test', 'noxfile.py']
5862

5963
nox.options.default_venv_backend = 'uv'
60-
nox.options.reuse_existing_virtualenvs = False
64+
nox.options.reuse_existing_virtualenvs = True
6165
nox.options.sessions = [
6266
'lint',
6367
'test',
@@ -225,8 +229,8 @@ def doc_cover(session):
225229
session.run('cat', report_file, external=True)
226230

227231
with open('build/coverage/python.txt') as fd:
228-
# If there is no undocumented files, the report should have only 2 lines (header)
229-
if sum(1 for _ in fd) != 2:
232+
# If there is no undocumented files, the report should have only 3 lines (header)
233+
if sum(1 for _ in fd) != 3:
230234
session.error('sphinx coverage has failed')
231235

232236

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ classifiers = [
2020
"Programming Language :: Python :: 3.11",
2121
"Programming Language :: Python :: 3.12",
2222
"Programming Language :: Python :: 3.13",
23+
"Programming Language :: Python :: 3.14",
2324
]
2425
dependencies = [
2526
"annotated_types>=0.5.0",
@@ -71,7 +72,7 @@ release = [
7172
]
7273
doc = [
7374
"sadisplay>=0.4.9",
74-
"sphinx>=5.3.0, <6",
75+
"sphinx>=7.4.7, <8",
7576
"sphinx-autobuild>=2021.3.14",
7677
"sphinx-rtd-theme>=2.0.0",
7778
"sphinx-autodoc-typehints>=1.23.0",

uv.lock

Lines changed: 8 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)