Skip to content

Commit de07242

Browse files
authored
Add Python 3.13 support to CI (#3103)
1 parent baf9ea8 commit de07242

File tree

11 files changed

+36
-26
lines changed

11 files changed

+36
-26
lines changed

.circleci/config.yml

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
version: 2.1
22

33
orbs:
4-
python: circleci/python@2.1.1
4+
python: circleci/python@3.0.0
55

66
jobs:
77
manylinux2014-aarch64:
88

99
parameters:
10-
NRN_PYTHON_VERSION:
10+
NRN_PYTHON_VERSION_MINOR:
1111
type: string
1212
NRN_NIGHTLY_UPLOAD:
1313
type: string
@@ -31,8 +31,8 @@ jobs:
3131
-e NRN_RELEASE_UPLOAD \
3232
-e SETUPTOOLS_SCM_PRETEND_VERSION \
3333
-e NRN_BUILD_FOR_UPLOAD=1 \
34-
'neuronsimulator/neuron_wheel:latest-gcc9-aarch64' \
35-
packaging/python/build_wheels.bash linux << parameters.NRN_PYTHON_VERSION >> coreneuron
34+
'neuronsimulator/neuron_wheel:latest-aarch64' \
35+
packaging/python/build_wheels.bash linux 3<< parameters.NRN_PYTHON_VERSION_MINOR >> coreneuron
3636
3737
- store_artifacts:
3838
path: ./wheelhouse
@@ -41,24 +41,16 @@ jobs:
4141
- run:
4242
name: Test manylinux AArch64 wheel
4343
command: |
44-
45-
# install mpi dependencies
4644
sudo apt update
45+
echo "deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu jammy main" | sudo tee /etc/apt/sources.list.d/deadsnakes-ppa.list && sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F23C5A6CF475977595C89F51BA6932366A755776 && sudo apt update
46+
sudo apt update
47+
# install mpi dependencies
4748
sudo apt install -y mpich openmpi-bin libopenmpi-dev libmpich-dev
49+
version=3.<< parameters.NRN_PYTHON_VERSION_MINOR >>
50+
# install Python from deadsnakes
51+
sudo apt install -y python${version}-venv libpython${version}-dev g++ make
4852
49-
# choose available python versions from pyenv
50-
pyenv_py_ver=""
51-
case << parameters.NRN_PYTHON_VERSION >> in
52-
39) pyenv_py_ver="3.9" ;;
53-
310) pyenv_py_ver="3.10" ;;
54-
311) pyenv_py_ver="3.11" ;;
55-
312) pyenv_py_ver="3.12" ;;
56-
*) echo "Error: pyenv python version not specified or not supported." && exit 1;;
57-
esac
58-
59-
env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install $pyenv_py_ver --force
60-
pyenv global $pyenv_py_ver
61-
export PYTHON_EXE=$(which python)
53+
export PYTHON_EXE=$(which python3.<< parameters.NRN_PYTHON_VERSION_MINOR >>)
6254
6355
# test wheel
6456
packaging/python/test_wheels.sh $PYTHON_EXE $(ls -t wheelhouse/*.whl)
@@ -86,7 +78,7 @@ workflows:
8678
- /circleci\/.*/
8779
matrix:
8880
parameters:
89-
NRN_PYTHON_VERSION: ["312"]
81+
NRN_PYTHON_VERSION_MINOR: ["13"]
9082
NRN_NIGHTLY_UPLOAD: ["false"]
9183

9284
nightly:
@@ -101,5 +93,5 @@ workflows:
10193
- manylinux2014-aarch64:
10294
matrix:
10395
parameters:
104-
NRN_PYTHON_VERSION: ["39", "310", "311", "312"]
96+
NRN_PYTHON_VERSION_MINOR: ["9", "10", "11", "12", "13"]
10597
NRN_NIGHTLY_UPLOAD: ["true"]

.github/workflows/coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ on:
2424
env:
2525
PY_MIN_VERSION: '3.9'
2626
PY_MID_VERSION: '3.10'
27-
PY_MAX_VERSION: '3.12'
27+
PY_MAX_VERSION: '3.13'
2828

2929
jobs:
3030
coverage:

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ on:
1717
- release/**
1818

1919
env:
20-
DEFAULT_PY_VERSION: '3.12'
20+
DEFAULT_PY_VERSION: '3.13'
2121

2222
jobs:
2323
documentation:

.github/workflows/neuron-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
DESIRED_CMAKE_VERSION: 3.17
4040
DYNAMIC_PYTHON_CMAKE_VERSION: 3.18
4141
PY_MIN_VERSION: ${{ matrix.config.python_min_version || '3.9' }}
42-
PY_MAX_VERSION: ${{ matrix.config.python_max_version || '3.12' }}
42+
PY_MAX_VERSION: ${{ matrix.config.python_max_version || '3.13' }}
4343
MUSIC_INSTALL_DIR: /opt/MUSIC
4444
# hash of commit containing mpi4py 4 fix
4545
MUSIC_VERSION: '13f312338dcccebfe74d391b1b24f1b6d816ac6c'

azure-pipelines.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ stages:
4242
python.version: '3.11'
4343
Python312:
4444
python.version: '3.12'
45+
Python313:
46+
python.version: '3.13'
47+
4548
steps:
4649

4750
# Secure files documentation:
@@ -74,7 +77,7 @@ stages:
7477
- script: |
7578
sudo apt update
7679
sudo apt install -y mpich openmpi-bin libopenmpi-dev libmpich-dev
77-
displayName: 'Install Test System Depdendencies'
80+
displayName: 'Install Test System Dependencies'
7881
7982
- template: ci/azure-wheel-test-upload.yml
8083

@@ -102,6 +105,10 @@ stages:
102105
python.version: '3.12'
103106
python.org.version: '3.12.0'
104107
python.installer.name: 'macos11.pkg'
108+
Python313:
109+
python.version: '3.13'
110+
python.org.version: '3.13.0'
111+
python.installer.name: 'macos11.pkg'
105112

106113
steps:
107114

ci/win_build_cmake.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ cd $BUILD_SOURCESDIRECTORY/build
3232
-DNRN_BINARY_DIST_BUILD=ON \
3333
-DPYTHON_EXECUTABLE=/c/Python39/python.exe \
3434
-DNRN_ENABLE_PYTHON_DYNAMIC=ON \
35-
-DNRN_PYTHON_DYNAMIC='c:/Python39/python.exe;c:/Python310/python.exe;c:/Python311/python.exe;c:/Python312/python.exe' \
35+
-DNRN_PYTHON_DYNAMIC='c:/Python39/python.exe;c:/Python310/python.exe;c:/Python311/python.exe;c:/Python312/python.exe;c:/Python313/python.exe' \
3636
-DCMAKE_INSTALL_PREFIX='/c/nrn-install' \
3737
-DMPI_CXX_LIB_NAMES:STRING=msmpi \
3838
-DMPI_C_LIB_NAMES:STRING=msmpi \

ci/win_download_deps.cmd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ pwsh -command Invoke-WebRequest -MaximumRetryCount 4 -OutFile python-3.9.exe htt
77
pwsh -command Invoke-WebRequest -MaximumRetryCount 4 -OutFile python-3.10.exe https://www.python.org/ftp/python/3.10.0/python-3.10.0-amd64.exe || goto :error
88
pwsh -command Invoke-WebRequest -MaximumRetryCount 4 -OutFile python-3.11.exe https://www.python.org/ftp/python/3.11.1/python-3.11.1-amd64.exe || goto :error
99
pwsh -command Invoke-WebRequest -MaximumRetryCount 4 -OutFile python-3.12.exe https://www.python.org/ftp/python/3.12.1/python-3.12.1-amd64.exe || goto :error
10+
pwsh -command Invoke-WebRequest -MaximumRetryCount 4 -OutFile python-3.13.exe https://www.python.org/ftp/python/3.13.0/python-3.13.0-amd64.exe || goto :error
1011

1112
:: mpi
1213
pwsh -command Invoke-WebRequest -MaximumRetryCount 4 -OutFile msmpisetup.exe https://download.microsoft.com/download/a/5/2/a5207ca5-1203-491a-8fb8-906fd68ae623/msmpisetup.exe || goto :error

ci/win_install_deps.cmd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ python-3.9.exe /passive Include_pip=1 Include_test=0 PrependPath=1 DefaultJustFo
77
python-3.10.exe /passive Include_pip=1 Include_test=0 PrependPath=1 DefaultJustForMeTargetDir=C:\Python310 || goto :error
88
python-3.11.exe /passive Include_pip=1 Include_test=0 PrependPath=1 DefaultJustForMeTargetDir=C:\Python311 || goto :error
99
python-3.12.exe /passive Include_pip=1 Include_test=0 PrependPath=1 DefaultJustForMeTargetDir=C:\Python312 || goto :error
10+
python-3.13.exe /passive Include_pip=1 Include_test=0 PrependPath=1 DefaultJustForMeTargetDir=C:\Python313 || goto :error
1011

1112
:: fix msvcc version for all python3
1213
pwsh -command "(Get-Content C:\Python39\Lib\distutils\cygwinccompiler.py) -replace 'elif msc_ver == ''1600'':', 'elif msc_ver == ''1927'':' | Out-File C:\Python39\Lib\distutils\cygwinccompiler.py"
@@ -24,8 +25,10 @@ C:\Python39\python.exe -m pip install numpy cython || goto :error
2425
C:\Python310\python.exe -m pip install numpy cython || goto :error
2526
C:\Python311\python.exe -m pip install numpy cython || goto :error
2627
C:\Python312\python.exe -m pip install numpy cython || goto :error
28+
C:\Python313\python.exe -m pip install numpy cython || goto :error
2729
:: setuptools 70.2 leads to an error
2830
C:\Python312\python.exe -m pip install setuptools==70.1.1 || goto :error
31+
C:\Python313\python.exe -m pip install setuptools==70.1.1 || goto :error
2932

3033
:: install nsis
3134
nsis-3.05-setup.exe /S || goto :error

ci/win_test_installer.cmd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,21 @@ C:\Python39\python -c "import neuron; neuron.test(); quit()" || set "errorfound=
2121
C:\Python310\python -c "import neuron; neuron.test(); quit()" || set "errorfound=y"
2222
C:\Python311\python -c "import neuron; neuron.test(); quit()" || set "errorfound=y"
2323
C:\Python312\python -c "import neuron; neuron.test(); quit()" || set "errorfound=y"
24+
C:\Python313\python -c "import neuron; neuron.test(); quit()" || set "errorfound=y"
2425

2526
:: install oldest supported numpy
2627
C:\Python39\python.exe -m pip install -r packaging/python/oldest_numpy_requirements.txt || goto :error
2728
C:\Python310\python.exe -m pip install -r packaging/python/oldest_numpy_requirements.txt || goto :error
2829
C:\Python311\python.exe -m pip install -r packaging/python/oldest_numpy_requirements.txt || goto :error
2930
C:\Python312\python.exe -m pip install -r packaging/python/oldest_numpy_requirements.txt || goto :error
31+
C:\Python313\python.exe -m pip install -r packaging/python/oldest_numpy_requirements.txt || goto :error
3032

3133
:: test all pythons again
3234
C:\Python39\python -c "import neuron; neuron.test(); quit()" || set "errorfound=y"
3335
C:\Python310\python -c "import neuron; neuron.test(); quit()" || set "errorfound=y"
3436
C:\Python311\python -c "import neuron; neuron.test(); quit()" || set "errorfound=y"
3537
C:\Python312\python -c "import neuron; neuron.test(); quit()" || set "errorfound=y"
38+
C:\Python313\python -c "import neuron; neuron.test(); quit()" || set "errorfound=y"
3639

3740
:: run also using whatever is system python
3841
python -m pip install numpy

packaging/python/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,7 @@ COPY Dockerfile .
9393
# build wheels from there
9494
WORKDIR /root
9595

96+
# remove Python 3.13t since we do not support the free-threaded build yet
97+
RUN rm -fr /opt/python/cp313-cp313t
98+
9699
ENV NMODL_PYLIB=/nrnwheel/python/lib/libpython3.10.so.1.0

packaging/python/oldest_numpy_requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ numpy==1.21.6;python_version=='3.9' and platform_machine=='arm64'
33
numpy==1.21.6;python_version=='3.10'
44
numpy==1.23.5;python_version=='3.11'
55
numpy==1.26.4;python_version=='3.12'
6+
numpy==2.1.0;python_version=='3.13'

0 commit comments

Comments
 (0)