Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated python 3.8 #3108

Merged
merged 5 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ jobs:
# choose available python versions from pyenv
pyenv_py_ver=""
case << parameters.NRN_PYTHON_VERSION >> in
38) pyenv_py_ver="3.8" ;;
39) pyenv_py_ver="3.9" ;;
310) pyenv_py_ver="3.10" ;;
311) pyenv_py_ver="3.11" ;;
Expand Down Expand Up @@ -102,5 +101,5 @@ workflows:
- manylinux2014-aarch64:
matrix:
parameters:
NRN_PYTHON_VERSION: ["38", "39", "310", "311", "312"]
NRN_PYTHON_VERSION: ["39", "310", "311", "312"]
NRN_NIGHTLY_UPLOAD: ["true"]
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/release-patch.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Releasing
- [ ] aarch64 wheels (use existing `release/x.y-aarch64` branch for this, see [guide](https://nrn.readthedocs.io/en/latest/install/python_wheels.html#publishing-the-wheels-on-pypi-via-circleci))
- [ ] Publish the `x.y.z` wheels on PyPI; see [wheel publishing instructions](https://nrn.readthedocs.io/en/latest/install/python_wheels.html#publishing-the-wheels-on-pypi-via-azure)
- [ ] Once wheels are published, activate the `x.y.z` tag on ReadTheDocs
- [ ] Rename the Windows installer in the GitHub release to match the new version and the supported python versions (i.e. `nrn-8.2.2.w64-mingw-py-37-38-39-310-311-setup.exe`)
- [ ] Rename the Windows installer in the GitHub release to match the new version and the supported python versions (i.e. `nrn-8.2.2.w64-mingw-py-39-310-311-312-setup.exe`)
- [ ] Publish release on GitHub (edit https://github.com/neuronsimulator/nrn/releases/tag/x.y.z and un-tick the pre-release checkbox)


Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Releasing
- [ ] aarch64 wheels (create a `release/x.y-aarch64` branch for this, see [guide](https://nrn.readthedocs.io/en/latest/install/python_wheels.html#publishing-the-wheels-on-pypi-via-circleci))
- [ ] Publish the `x.y.z` wheels on Pypi; see [wheel publishing instructions](https://nrn.readthedocs.io/en/latest/install/python_wheels.html#publishing-the-wheels-on-pypi-via-azure)
- [ ] Once wheels are published, activate the `x.y.z` tag on ReadTheDocs
- [ ] Rename the Windows installer in the GitHub release to match the new version and the supported python versions (i.e. `nrn-8.2.2.w64-mingw-py-37-38-39-310-311-setup.exe`
- [ ] Rename the Windows installer in the GitHub release to match the new version and the supported python versions (i.e. `nrn-8.2.2.w64-mingw-py-39-310-311-312-setup.exe`
)
- [ ] Publish release on GitHub (edit https://github.com/neuronsimulator/nrn/releases/tag/x.y.z and un-tick the pre-release checkbox)

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

env:
PY_MIN_VERSION: '3.8'
PY_MIN_VERSION: '3.9'
PY_MID_VERSION: '3.10'
PY_MAX_VERSION: '3.12'

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 @@ -38,7 +38,7 @@ jobs:
BUILD_TYPE: Release
DESIRED_CMAKE_VERSION: 3.17
DYNAMIC_PYTHON_CMAKE_VERSION: 3.18
PY_MIN_VERSION: ${{ matrix.config.python_min_version || '3.8' }}
PY_MIN_VERSION: ${{ matrix.config.python_min_version || '3.9' }}
PY_MAX_VERSION: ${{ matrix.config.python_max_version || '3.12' }}
MUSIC_INSTALL_DIR: /opt/MUSIC
MUSIC_VERSION: 1.2.1
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ string(REPLACE "," ";" NRN_SANITIZERS_LIST "${NRN_SANITIZERS}")
# NRN_DEFAULT_PYTHON_LIBRARIES are its include direcory and library
# * NRN_PYTHON_EXECUTABLES is a list of absolute paths to all Python executables to be built against
# (length >=1 if NRN_ENABLE_PYTHON_DYNAMIC else == 1)
# * NRN_PYTHON_VERSIONS (3.8, 3.11, ...), NRN_PYTHON_INCLUDES and NRN_PYTHON_LIBRARIES are populated
# * NRN_PYTHON_VERSIONS (3.9, 3.11, ...), NRN_PYTHON_INCLUDES and NRN_PYTHON_LIBRARIES are populated
# with values patching NRN_PYTHON_EXECUTABLES
# * NRN_PYTHON_COUNT is set to the number of entries in those lists (i.e. number of Pythons), and
# NRN_PYTHON_ITERATION_LIMIT is set to ${NRN_PYTHON_COUNT} - 1
Expand Down
6 changes: 0 additions & 6 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ stages:
vmImage: 'ubuntu-20.04'
strategy:
matrix:
Python38:
python.version: '3.8'
Python39:
python.version: '3.9'
Python310:
Expand Down Expand Up @@ -88,10 +86,6 @@ stages:
vmImage: 'macOS-13'
strategy:
matrix:
Python38:
python.version: '3.8'
python.org.version: '3.8.9'
python.installer.name: 'macosx10.9.pkg'
Python39:
python.version: '3.9'
python.org.version: '3.9.13'
Expand Down
2 changes: 1 addition & 1 deletion ci/win_build_cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ cd $BUILD_SOURCESDIRECTORY/build
-DNRN_BINARY_DIST_BUILD=ON \
-DPYTHON_EXECUTABLE=/c/Python39/python.exe \
-DNRN_ENABLE_PYTHON_DYNAMIC=ON \
-DNRN_PYTHON_DYNAMIC='c:/Python38/python.exe;c:/Python39/python.exe;c:/Python310/python.exe;c:/Python311/python.exe;c:/Python312/python.exe' \
-DNRN_PYTHON_DYNAMIC='c:/Python39/python.exe;c:/Python310/python.exe;c:/Python311/python.exe;c:/Python312/python.exe' \
-DCMAKE_INSTALL_PREFIX='/c/nrn-install' \
-DMPI_CXX_LIB_NAMES:STRING=msmpi \
-DMPI_C_LIB_NAMES:STRING=msmpi \
Expand Down
1 change: 0 additions & 1 deletion ci/win_download_deps.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:: download all installers

:: python
pwsh -command Invoke-WebRequest -MaximumRetryCount 4 -OutFile python-3.8.exe https://www.python.org/ftp/python/3.8.2/python-3.8.2-amd64.exe || goto :error
pwsh -command Invoke-WebRequest -MaximumRetryCount 4 -OutFile python-3.9.exe https://www.python.org/ftp/python/3.9.0/python-3.9.0-amd64.exe || goto :error
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
Expand Down
4 changes: 0 additions & 4 deletions ci/win_install_deps.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,23 @@
:: install all dependencies

:: install python
python-3.8.exe /passive Include_pip=1 Include_test=0 PrependPath=1 DefaultJustForMeTargetDir=C:\Python38 || goto :error
python-3.9.exe /passive Include_pip=1 Include_test=0 PrependPath=1 DefaultJustForMeTargetDir=C:\Python39 || goto :error
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

:: fix msvcc version for all python3
pwsh -command "(Get-Content C:\Python38\Lib\distutils\cygwinccompiler.py) -replace 'elif msc_ver == ''1600'':', 'elif msc_ver == ''1916'':' | Out-File C:\Python38\Lib\distutils\cygwinccompiler.py"
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"
pwsh -command "(Get-Content C:\Python310\Lib\distutils\cygwinccompiler.py) -replace 'elif msc_ver == ''1600'':', 'elif msc_ver == ''1929'':' | Out-File C:\Python310\Lib\distutils\cygwinccompiler.py"
pwsh -command "(Get-Content C:\Python311\Lib\distutils\cygwinccompiler.py) -replace 'elif msc_ver == ''1600'':', 'elif msc_ver == ''1934'':' | Out-File C:\Python311\Lib\distutils\cygwinccompiler.py"


:: fix msvc runtime library for all python
pwsh -command "(Get-Content C:\Python38\Lib\distutils\cygwinccompiler.py) -replace 'msvcr100', 'msvcrt' | Out-File C:\Python38\Lib\distutils\cygwinccompiler.py"
pwsh -command "(Get-Content C:\Python39\Lib\distutils\cygwinccompiler.py) -replace 'msvcr100', 'msvcrt' | Out-File C:\Python39\Lib\distutils\cygwinccompiler.py"
pwsh -command "(Get-Content C:\Python310\Lib\distutils\cygwinccompiler.py) -replace 'msvcr100', 'msvcrt' | Out-File C:\Python310\Lib\distutils\cygwinccompiler.py"
pwsh -command "(Get-Content C:\Python311\Lib\distutils\cygwinccompiler.py) -replace 'msvcr100', 'msvcrt' | Out-File C:\Python311\Lib\distutils\cygwinccompiler.py"

:: install numpy
C:\Python38\python.exe -m pip install numpy cython || goto :error
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
Expand Down
3 changes: 0 additions & 3 deletions ci/win_test_installer.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,18 @@ echo %NEURONHOME%
if not exist association.hoc.out (start /wait /REALTIME %cd%\ci\association.hoc)

:: test all pythons
C:\Python38\python -c "import neuron; neuron.test(); quit()" || set "errorfound=y"
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"

:: install oldest supported numpy
C:\Python38\python.exe -m pip install -r packaging/python/oldest_numpy_requirements.txt || goto :error
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

:: test all pythons again
C:\Python38\python -c "import neuron; neuron.test(); quit()" || set "errorfound=y"
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"
Expand Down
10 changes: 5 additions & 5 deletions docs/install/python_wheels.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ ls -la wheelhouse

You can build the wheel for a specific python version:
```
bash packaging/python/build_wheels.bash linux 38 # 38 for Python v3.8
bash packaging/python/build_wheels.bash linux 39 # 39 for Python v3.9
```

To build wheels with CoreNEURON support you have to pass an additional argument: `coreneuron`.
Expand Down Expand Up @@ -195,10 +195,10 @@ To test the generated wheels, you can do:

```
# first arg is a python exe and second arg is the corresponding wheel
bash packaging/python/test_wheels.sh python3.8 wheelhouse/NEURON-7.8.0.236-cp38-cp38-macosx_10_9_x86_64.whl
bash packaging/python/test_wheels.sh python3.9 wheelhouse/NEURON-7.8.0.236-cp39-cp39-macosx_10_9_x86_64.whl

# Or, you can provide the pypi url
bash packaging/python/test_wheels.sh python3.8 "-i https://test.pypi.org/simple/NEURON==7.8.11.2"
bash packaging/python/test_wheels.sh python3.9 "-i https://test.pypi.org/simple/NEURON==7.8.11.2"
```

### MacOS considerations
Expand All @@ -212,7 +212,7 @@ On BB5, we can test CPU wheels with:
```
salloc -A proj16 -N 1 --ntasks-per-node=4 -C "cpu" --time=1:00:00 -p interactive
module load unstable python
bash packaging/python/test_wheels.sh python3.8 wheelhouse/NEURON-7.8.0.236-cp38-cp38m-manylinux1_x86_64.whl
bash packaging/python/test_wheels.sh python3.9 wheelhouse/NEURON-7.8.0.236-cp39-cp39-manylinux1_x86_64.whl
```

## Publishing the wheels on Pypi via Azure
Expand Down Expand Up @@ -291,7 +291,7 @@ $ git diff
matrix:
parameters:
- NRN_PYTHON_VERSION: ["311"]
+ NRN_PYTHON_VERSION: ["38", "39", "310", "311", "312"]
+ NRN_PYTHON_VERSION: ["39", "310", "311", "312"]
NRN_NIGHTLY_UPLOAD: ["false"]

nightly:
Expand Down
4 changes: 2 additions & 2 deletions docs/install/windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ As you can see in the script, a typical configuration would be:
-DNRN_ENABLE_PYTHON=ON \
-DNRN_ENABLE_RX3D=ON \
-DNRN_RX3D_OPT_LEVEL=2 \
-DPYTHON_EXECUTABLE=/c/Python38/python.exe \
-DPYTHON_EXECUTABLE=/c/Python39/python.exe \
-DNRN_ENABLE_PYTHON_DYNAMIC=ON \
-DNRN_PYTHON_DYNAMIC='c:/Python38/python.exe;c:/Python39/python.exe;c:/Python310/python.exe;c:/Python311/python.exe' \
-DNRN_PYTHON_DYNAMIC='c:/Python39/python.exe;c:/Python310/python.exe;c:/Python311/python.exe' \
-DCMAKE_INSTALL_PREFIX='/c/nrn-install' \
-DMPI_CXX_LIB_NAMES:STRING=msmpi \
-DMPI_C_LIB_NAMES:STRING=msmpi \
Expand Down
4 changes: 2 additions & 2 deletions src/mswin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
# /mingw64/bin/cmake .. -G "Unix Makefiles" \
# -DCMAKE_INSTALL_PREFIX=/C/marshalnrn/nrn \
# -DIV_DIR=/home/hines/neuron/ivcmake/build/install \
# -DPYTHON_EXECUTABLE=/e/python38/python \
# -DPYTHON_EXECUTABLE=/e/python39/python \
# -DNRN_ENABLE_PYTHON_DYNAMIC=ON \
# -DNRN_PYTHON_DYNAMIC="e:/python38/python;e:/python39/python;e:/python310/python;e:/python311/python" \
# -DNRN_PYTHON_DYNAMIC="e:/python39/python;e:/python39/python;e:/python310/python;e:/python311/python" \
# -DNRN_ENABLE_MPI_DYNAMIC=ON \
# -DCMAKE_PREFIX_PATH="/c/ms-mpi" \
# -DNRN_ENABLE_CORENEURON=Off
Expand Down
2 changes: 1 addition & 1 deletion src/nrniv/nrnpy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ void nrnpython_reg() {
static nrnpython_reg_real_t load_nrnpython() {
std::string pyversion{};
if (auto const pv10 = nrn_is_python_extension; pv10 > 0) {
// pv10 is one of the packed integers like 310 (3.10) or 38 (3.8)
// pv10 is one of the packed integers like 310 (3.10) or 39 (3.9)
auto const factor = (pv10 >= 100) ? 100 : 10;
pyversion = std::to_string(pv10 / factor) + "." + std::to_string(pv10 % factor);
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/nrnpython/nrnpython.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
#define PyInt_AsLong PyLong_AsLong
#define PyInt_FromLong PyLong_FromLong

static_assert(PY_MAJOR_VERSION > 3 || (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 8),
"Python >= 3.8 required");
static_assert(PY_MAJOR_VERSION > 3 || (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 9),
"Python >= 3.9 required");

extern PyObject* nrnpy_hoc_pop(const char* mes);
extern int nrnpy_numbercheck(PyObject*);
Expand Down
Loading