Skip to content

Commit 075ce82

Browse files
authored
Add Python 3.13 Support (#2080)
* Add Python 3.13 support * Update grpc dependencies for 3.13 compatibility * Fix unit test failures * Update changelog * Use Python 3.12 as the primary version * Rerun codegen * Update test env dependencies to be compatible with Python 3.13 * Disable ensure_codegen_up_to_date for Python 3.13 in .travis.yml * Eliminate protobuf upper bound * Expand on comments, describing when we can stop using Python 3.12
1 parent 5175d2e commit 075ce82

File tree

27 files changed

+75
-49
lines changed

27 files changed

+75
-49
lines changed

.github/actions/run_examples_using_pypi_uploads/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ runs:
1515
steps:
1616
# The local wheel installation and single environment would have made using tox-system_tests.ini difficult.
1717
# To keep things simple, we just use pip and pytest directly for a single Python version.
18-
- run: py -3.12 -m venv --clear .venv
18+
- run: py -3.13 -m venv --clear .venv
1919
shell: powershell
2020
- run: |
2121
.venv\Scripts\Activate.ps1

.travis.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@ language: python
33
dist: focal
44
matrix:
55
include:
6-
# We run tests on the latest supported version of Python first.
6+
# Historically, we've run tests on the latest supported version of Python first.
7+
# For now, we're running Python 3.12 first, because it's the version currently used for codegen.
78
# This is where additional tests are run so we give it more time.
9+
# When the version used for codegen changes, the version that runs first should change to match.
810
- python: "3.12"
911
- python: "3.9"
1012
- python: "3.10"
1113
- python: "3.11"
14+
- python: "3.13"
1215

1316
install:
1417
- travis_retry sudo apt-get -y install python3-pip
@@ -18,7 +21,8 @@ install:
1821
- travis_retry pip install --upgrade tox==3.* tox-travis
1922

2023
before_script:
21-
- python tools/ensure_codegen_up_to_date.py
24+
# Python 3.13 is only supported by grpcio-tools >= 1.67.0, a later version than what we use in the tox.ini
25+
- if [[ "$TRAVIS_PYTHON_VERSION" != "3.13" ]]; then python tools/ensure_codegen_up_to_date.py; fi
2226

2327
script:
2428
- tox -c tox-travis.ini

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ All notable changes to this project will be documented in this file.
3838
## Unreleased
3939
* ### ALL
4040
* #### Added
41+
* Support for Python 3.13
4142
* #### Changed
4243
* Fix [#2069](https://github.com/ni/nimi-python/issues/2069)
4344
* #### Removed

build/templates/setup.py.mako

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ setup(
4646
extras_require={
4747
'grpc': [
4848
'grpcio>=1.59.0,<2.0',
49-
'protobuf>=4.21.6,<5.0'
49+
'protobuf>=4.21.6'
5050
],
5151
},
5252
% endif
@@ -63,6 +63,7 @@ setup(
6363
"Programming Language :: Python :: 3.10",
6464
"Programming Language :: Python :: 3.11",
6565
"Programming Language :: Python :: 3.12",
66+
"Programming Language :: Python :: 3.13",
6667
"Programming Language :: Python :: Implementation :: CPython",
6768
"Topic :: System :: Hardware :: Hardware Drivers"
6869
],

build/templates/tox-system_tests.ini.mako

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
wheel_env_no_py = '{}-wheel_dep'.format(module_name)
1212
# We only actually need to build it once, but we specify multiple versions here
1313
# to prevent tox from trying to build the wheel with an unsupported (earlier) Python version
14-
wheel_env = 'py{39,310,311,312}-' + wheel_env_no_py + ','
14+
wheel_env = 'py{39,310,311,312,313}-' + wheel_env_no_py + ','
1515
uses_other_wheel = True
1616
if module_name == 'nitclk':
1717
# nitclk system tests use niscope
@@ -28,7 +28,7 @@
2828
# test suite on all supported python versions. To use it, "pip install tox"
2929
# and then run "tox -c tox-system_tests.ini" from the driver directory. (generated/${module_name})
3030
[tox]
31-
envlist = ${wheel_env}py{39,310,311,312}-${module_name}-system_tests, py312-${module_name}-coverage
31+
envlist = ${wheel_env}py{39,310,311,312,313}-${module_name}-system_tests, py313-${module_name}-coverage
3232
skip_missing_interpreters=True
3333
ignore_basepython_conflict=True
3434
# We put the .tox directory outside of the Jenkins workspace so that it isn't wiped with the rest of the repo
@@ -87,7 +87,7 @@ deps =
8787
${module_name}-coverage: coverage
8888

8989
depends =
90-
${module_name}-coverage: py{39,310,311,312}-${module_name}-system_tests
90+
${module_name}-coverage: py{39,310,311,312,313}-${module_name}-system_tests
9191
% if uses_other_wheel:
9292
${module_name}-system_tests: ${wheel_env}
9393
% endif

generated/nidcpower/setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def read_contents(file_to_read):
3636
extras_require={
3737
'grpc': [
3838
'grpcio>=1.59.0,<2.0',
39-
'protobuf>=4.21.6,<5.0'
39+
'protobuf>=4.21.6'
4040
],
4141
},
4242
classifiers=[
@@ -52,6 +52,7 @@ def read_contents(file_to_read):
5252
"Programming Language :: Python :: 3.10",
5353
"Programming Language :: Python :: 3.11",
5454
"Programming Language :: Python :: 3.12",
55+
"Programming Language :: Python :: 3.13",
5556
"Programming Language :: Python :: Implementation :: CPython",
5657
"Topic :: System :: Hardware :: Hardware Drivers"
5758
],

generated/nidcpower/tox-system_tests.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# test suite on all supported python versions. To use it, "pip install tox"
44
# and then run "tox -c tox-system_tests.ini" from the driver directory. (generated/nidcpower)
55
[tox]
6-
envlist = py{39,310,311,312}-nidcpower-system_tests, py312-nidcpower-coverage
6+
envlist = py{39,310,311,312,313}-nidcpower-system_tests, py313-nidcpower-coverage
77
skip_missing_interpreters=True
88
ignore_basepython_conflict=True
99
# We put the .tox directory outside of the Jenkins workspace so that it isn't wiped with the rest of the repo
@@ -43,7 +43,7 @@ deps =
4343
nidcpower-coverage: coverage
4444

4545
depends =
46-
nidcpower-coverage: py{39,310,311,312}-nidcpower-system_tests
46+
nidcpower-coverage: py{39,310,311,312,313}-nidcpower-system_tests
4747

4848
passenv =
4949
GIT_BRANCH

generated/nidigital/setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def read_contents(file_to_read):
3737
extras_require={
3838
'grpc': [
3939
'grpcio>=1.59.0,<2.0',
40-
'protobuf>=4.21.6,<5.0'
40+
'protobuf>=4.21.6'
4141
],
4242
},
4343
classifiers=[
@@ -53,6 +53,7 @@ def read_contents(file_to_read):
5353
"Programming Language :: Python :: 3.10",
5454
"Programming Language :: Python :: 3.11",
5555
"Programming Language :: Python :: 3.12",
56+
"Programming Language :: Python :: 3.13",
5657
"Programming Language :: Python :: Implementation :: CPython",
5758
"Topic :: System :: Hardware :: Hardware Drivers"
5859
],

generated/nidigital/tox-system_tests.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# test suite on all supported python versions. To use it, "pip install tox"
44
# and then run "tox -c tox-system_tests.ini" from the driver directory. (generated/nidigital)
55
[tox]
6-
envlist = py{39,310,311,312}-nidigital-wheel_dep,py{39,310,311,312}-nidigital-system_tests, py312-nidigital-coverage
6+
envlist = py{39,310,311,312,313}-nidigital-wheel_dep,py{39,310,311,312,313}-nidigital-system_tests, py313-nidigital-coverage
77
skip_missing_interpreters=True
88
ignore_basepython_conflict=True
99
# We put the .tox directory outside of the Jenkins workspace so that it isn't wiped with the rest of the repo
@@ -50,8 +50,8 @@ deps =
5050
nidigital-coverage: coverage
5151

5252
depends =
53-
nidigital-coverage: py{39,310,311,312}-nidigital-system_tests
54-
nidigital-system_tests: py{39,310,311,312}-nidigital-wheel_dep,
53+
nidigital-coverage: py{39,310,311,312,313}-nidigital-system_tests
54+
nidigital-system_tests: py{39,310,311,312,313}-nidigital-wheel_dep,
5555

5656
passenv =
5757
GIT_BRANCH

generated/nidmm/setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def read_contents(file_to_read):
3636
extras_require={
3737
'grpc': [
3838
'grpcio>=1.59.0,<2.0',
39-
'protobuf>=4.21.6,<5.0'
39+
'protobuf>=4.21.6'
4040
],
4141
},
4242
classifiers=[
@@ -52,6 +52,7 @@ def read_contents(file_to_read):
5252
"Programming Language :: Python :: 3.10",
5353
"Programming Language :: Python :: 3.11",
5454
"Programming Language :: Python :: 3.12",
55+
"Programming Language :: Python :: 3.13",
5556
"Programming Language :: Python :: Implementation :: CPython",
5657
"Topic :: System :: Hardware :: Hardware Drivers"
5758
],

0 commit comments

Comments
 (0)