Skip to content

Commit

Permalink
Add support for Python 3.13
Browse files Browse the repository at this point in the history
  • Loading branch information
JCGoran committed Dec 4, 2024
1 parent d24a901 commit bb74a5f
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 5 deletions.
5 changes: 3 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ jobs:
310) pyenv_py_ver="3.10" ;;
311) pyenv_py_ver="3.11" ;;
312) pyenv_py_ver="3.12" ;;
313) pyenv_py_ver="3.13" ;;
*) echo "Error: pyenv python version not specified or not supported." && exit 1;;
esac
Expand Down Expand Up @@ -86,7 +87,7 @@ workflows:
- /circleci\/.*/
matrix:
parameters:
NRN_PYTHON_VERSION: ["312"]
NRN_PYTHON_VERSION: ["313"]
NRN_NIGHTLY_UPLOAD: ["false"]

nightly:
Expand All @@ -101,5 +102,5 @@ workflows:
- manylinux2014-aarch64:
matrix:
parameters:
NRN_PYTHON_VERSION: ["39", "310", "311", "312"]
NRN_PYTHON_VERSION: ["39", "310", "311", "312", "313"]
NRN_NIGHTLY_UPLOAD: ["true"]
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ on:
env:
PY_MIN_VERSION: '3.9'
PY_MID_VERSION: '3.10'
PY_MAX_VERSION: '3.12'
PY_MAX_VERSION: '3.13'

jobs:
coverage:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
- release/**

env:
DEFAULT_PY_VERSION: '3.12'
DEFAULT_PY_VERSION: '3.13'

jobs:
documentation:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/neuron-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
DESIRED_CMAKE_VERSION: 3.17
DYNAMIC_PYTHON_CMAKE_VERSION: 3.18
PY_MIN_VERSION: ${{ matrix.config.python_min_version || '3.9' }}
PY_MAX_VERSION: ${{ matrix.config.python_max_version || '3.12' }}
PY_MAX_VERSION: ${{ matrix.config.python_max_version || '3.13' }}
MUSIC_INSTALL_DIR: /opt/MUSIC
# hash of commit containing mpi4py 4 fix
MUSIC_VERSION: '13f312338dcccebfe74d391b1b24f1b6d816ac6c'
Expand Down
7 changes: 7 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ stages:
python.version: '3.11'
Python312:
python.version: '3.12'
Python313:
python.version: '3.13'

steps:

# Secure files documentation:
Expand Down Expand Up @@ -102,6 +105,10 @@ stages:
python.version: '3.12'
python.org.version: '3.12.0'
python.installer.name: 'macos11.pkg'
Python313:
python.version: '3.13'
python.org.version: '3.13.0'
python.installer.name: 'macos11.pkg'

steps:

Expand Down
1 change: 1 addition & 0 deletions ci/win_download_deps.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ pwsh -command Invoke-WebRequest -MaximumRetryCount 4 -OutFile python-3.9.exe htt
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
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
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
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

:: mpi
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
Expand Down
3 changes: 3 additions & 0 deletions ci/win_install_deps.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ python-3.9.exe /passive Include_pip=1 Include_test=0 PrependPath=1 DefaultJustFo
python-3.10.exe /passive Include_pip=1 Include_test=0 PrependPath=1 DefaultJustForMeTargetDir=C:\Python310 || goto :error
python-3.11.exe /passive Include_pip=1 Include_test=0 PrependPath=1 DefaultJustForMeTargetDir=C:\Python311 || goto :error
python-3.12.exe /passive Include_pip=1 Include_test=0 PrependPath=1 DefaultJustForMeTargetDir=C:\Python312 || goto :error
python-3.13.exe /passive Include_pip=1 Include_test=0 PrependPath=1 DefaultJustForMeTargetDir=C:\Python313 || goto :error

:: fix msvcc version for all python3
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"
Expand All @@ -24,8 +25,10 @@ C:\Python39\python.exe -m pip install numpy cython || goto :error
C:\Python310\python.exe -m pip install numpy cython || goto :error
C:\Python311\python.exe -m pip install numpy cython || goto :error
C:\Python312\python.exe -m pip install numpy cython || goto :error
C:\Python313\python.exe -m pip install numpy cython || goto :error
:: setuptools 70.2 leads to an error
C:\Python312\python.exe -m pip install setuptools==70.1.1 || goto :error
C:\Python313\python.exe -m pip install setuptools==70.1.1 || goto :error

:: install nsis
nsis-3.05-setup.exe /S || goto :error
Expand Down
3 changes: 3 additions & 0 deletions ci/win_test_installer.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,21 @@ C:\Python39\python -c "import neuron; neuron.test(); quit()" || set "errorfound=
C:\Python310\python -c "import neuron; neuron.test(); quit()" || set "errorfound=y"
C:\Python311\python -c "import neuron; neuron.test(); quit()" || set "errorfound=y"
C:\Python312\python -c "import neuron; neuron.test(); quit()" || set "errorfound=y"
C:\Python313\python -c "import neuron; neuron.test(); quit()" || set "errorfound=y"

:: install oldest supported numpy
C:\Python39\python.exe -m pip install -r packaging/python/oldest_numpy_requirements.txt || goto :error
C:\Python310\python.exe -m pip install -r packaging/python/oldest_numpy_requirements.txt || goto :error
C:\Python311\python.exe -m pip install -r packaging/python/oldest_numpy_requirements.txt || goto :error
C:\Python312\python.exe -m pip install -r packaging/python/oldest_numpy_requirements.txt || goto :error
C:\Python313\python.exe -m pip install -r packaging/python/oldest_numpy_requirements.txt || goto :error

:: test all pythons again
C:\Python39\python -c "import neuron; neuron.test(); quit()" || set "errorfound=y"
C:\Python310\python -c "import neuron; neuron.test(); quit()" || set "errorfound=y"
C:\Python311\python -c "import neuron; neuron.test(); quit()" || set "errorfound=y"
C:\Python312\python -c "import neuron; neuron.test(); quit()" || set "errorfound=y"
C:\Python313\python -c "import neuron; neuron.test(); quit()" || set "errorfound=y"

:: run also using whatever is system python
python -m pip install numpy
Expand Down
1 change: 1 addition & 0 deletions packaging/python/oldest_numpy_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ numpy==1.21.6;python_version=='3.9' and platform_machine=='arm64'
numpy==1.21.6;python_version=='3.10'
numpy==1.23.5;python_version=='3.11'
numpy==1.26.4;python_version=='3.12'
numpy==2.1.0;python_version=='3.13'

0 comments on commit bb74a5f

Please sign in to comment.