Skip to content

Commit 3432262

Browse files
ptheywoodmondus
andauthored
Python 3.10 to 3.14 (#1320)
* Update Python supported versions and CI to 3.10-3.14 - Removes python 3.9 (but does not strictly prevent it) - Adds Python 3.14 - Uses 3.14 for 'regular' CI * Changes to module annotations for py3.14 --------- Co-authored-by: Mondus <p.richmond@sheffield.ac.uk>
1 parent 327c523 commit 3432262

7 files changed

Lines changed: 13 additions & 17 deletions

File tree

.github/workflows/Draft-Release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ defaults:
2626
# + Thorough Windows builds
2727
# + Oldest and newest cuda, lots of arch, vis off, tests on
2828
# + Wheel producing manylinux builds
29-
# + CUDA 12.0 and 13.0, py 3.9-3.13, vis on/off, py only.
29+
# + CUDA 12.0 and 13.0, py 3.10-3.14, vis on/off, py only.
3030
# + Wheel producing Windows builds
31-
# + CUDA 12.4 and 13.0, py 3.9-3.13, vis on/off, py only.
31+
# + CUDA 12.4 and 13.0, py 3.10-3.14, vis on/off, py only.
3232
# + Draft github release workflow.
3333

3434
jobs:
@@ -56,7 +56,7 @@ jobs:
5656
hostcxx: gcc-10
5757
os: ubuntu-22.04
5858
python:
59-
- "3.9"
59+
- "3.10"
6060
config:
6161
- name: "Release"
6262
config: "Release"
@@ -204,7 +204,7 @@ jobs:
204204
hostcxx: "Visual Studio 17 2022"
205205
os: windows-2022
206206
python:
207-
- "3.9"
207+
- "3.10"
208208
config:
209209
- name: "Release"
210210
config: "Release"
@@ -325,11 +325,11 @@ jobs:
325325
hostcxx: gcc-toolset-12
326326
os: ubuntu-24.04
327327
python:
328+
- "3.14"
328329
- "3.13"
329330
- "3.12"
330331
- "3.11"
331332
- "3.10"
332-
- "3.9"
333333
config:
334334
- name: "Release"
335335
config: "Release"
@@ -504,11 +504,11 @@ jobs:
504504
hostcxx: "Visual Studio 17 2022"
505505
os: windows-2022
506506
python:
507+
- "3.14"
507508
- "3.13"
508509
- "3.12"
509510
- "3.11"
510511
- "3.10"
511-
- "3.9"
512512
config:
513513
- name: "Release"
514514
config: "Release"

.github/workflows/MPI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
hostcxx: gcc-11
3838
os: ubuntu-22.04
3939
python:
40-
- "3.9"
40+
- "3.10"
4141
mpi:
4242
- lib: "openmpi"
4343
version: "apt" # MPI 3.1

.github/workflows/Manylinux_2_28.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
hostcxx: gcc-toolset-12
4545
os: ubuntu-24.04
4646
python:
47-
- "3.12"
47+
- "3.14"
4848
config:
4949
- name: "Release"
5050
config: "Release"

.github/workflows/Ubuntu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
hostcxx: gcc-10
4545
os: ubuntu-22.04
4646
python:
47-
- "3.12"
47+
- "3.14"
4848
config:
4949
- name: "Release"
5050
config: "Release"

.github/workflows/Windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
hostcxx: "Visual Studio 17 2022"
4646
os: windows-2022
4747
python:
48-
- "3.12"
48+
- "3.14"
4949
config:
5050
- name: "Release"
5151
config: "Release"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Optionally:
7777

7878
+ [cpplint](https://github.com/cpplint/cpplint) for linting code
7979
+ [Doxygen](http://www.doxygen.nl/) to build the documentation
80-
+ [Python](https://www.python.org/) `>= 3.9` for python integration
80+
+ [Python](https://www.python.org/) `>= 3.10` for python integration
8181
+ With `setuptools`, `wheel`, `build` and optionally `venv` python packages installed
8282
+ On Windows, CUDA >= 12.4 is required for python integration
8383
+ [swig](http://www.swig.org/) `>= 4.1.0` for python integration (with c++20 support)

swig/python/codegen/__init__.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,8 @@ def translate(function: Union[str, Callable]) -> str:
4242
tree = ast.parse(function_source)
4343
# Filter constants
4444
module_members = inspect.getmembers(module);
45-
# Emulate inspect.get_annotations() (requires python 3.10+)
46-
module_annontations = {}
47-
for mem in module_members:
48-
if mem[0] == "__annotations__":
49-
module_annontations = mem[1]
50-
break
45+
# Requires python 3.10+
46+
module_annontations = inspect.get_annotations(module)
5147
prepend_c_source = ""
5248
# Find all annotated variables
5349
for key, val in module_annontations.items():

0 commit comments

Comments
 (0)