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

release/8.2 can use Python 3.13 #3317

Open
wants to merge 27 commits into
base: release/8.2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
6d91299
Python 3.13.1 broke [s for s in sl] where sl is a SectionList.
nrnhines Jan 22, 2025
c624c94
Launching nrniv -python with Python 3.13.0 does not allow use of gui.…
nrnhines Nov 22, 2024
871dcd9
Pick items from 61dfd7c (#3028) and 2996006 (#3040)
nrnhines Jan 22, 2025
01297ef
Pick just about everything from de07242b #3103
nrnhines Jan 22, 2025
880a62f
bldnrnmacpkg.sh is the new name and updated for python3.13 (#3266)
nrnhines Dec 6, 2024
9d9f281
adopt wholesale the files in master ci folder into 8.2
nrnhines Jan 23, 2025
25a0e20
adopt wholesale master packaging and setup.py into 8.2 with two excep…
nrnhines Jan 23, 2025
1f7ad47
adopt master .github/workflows into 8.2. Deal with music, nmodl later.
nrnhines Jan 23, 2025
5865676
adopt master python *requirements.txt file into 8.2
nrnhines Jan 23, 2025
f0aec26
remove music from coverage.yml and NRN_ENABLE_PERFORMANCE_TESTS
nrnhines Jan 23, 2025
0608176
Revert "remove music from coverage.yml and NRN_ENABLE_PERFORMANCE_TESTS"
nrnhines Jan 23, 2025
6f666c6
Revert "adopt master python *requirements.txt file into 8.2"
nrnhines Jan 23, 2025
6a484bf
Revert "adopt master .github/workflows into 8.2. Deal with music, nmo…
nrnhines Jan 23, 2025
574cc8f
Revert "adopt wholesale master packaging and setup.py into 8.2 with t…
nrnhines Jan 23, 2025
81f0d95
Revert "adopt wholesale the files in master ci folder into 8.2"
nrnhines Jan 23, 2025
aea8d6a
Revert "bldnrnmacpkg.sh is the new name and updated for python3.13 (#…
nrnhines Jan 23, 2025
cc057d4
Revert "Pick just about everything from de07242b #3103"
nrnhines Jan 23, 2025
a58e093
Revert "Pick items from 61dfd7c (#3028) and 2996006 (#3040)"
nrnhines Jan 23, 2025
d23569d
everywhere python 3.11 is mentioned, possibly allow 3.13
nrnhines Jan 23, 2025
a517ac0
increase to macos-13
nrnhines Jan 23, 2025
571833d
bash syntax for less than or equal
nrnhines Jan 23, 2025
cabd673
coreneuron from https://github.com/neuronsimulator/CoreNeuron
nrnhines Jan 24, 2025
fd26116
numpy cython consistent versions for 3.13 and below
nrnhines Jan 24, 2025
84df17d
default cython and numpy versions
nrnhines Jan 24, 2025
49cc640
tentative strategy for matching Python OSX framework.
nrnhines Jan 24, 2025
f756fe8
tentative demand for numpy>=2 and cython>=3
nrnhines Jan 24, 2025
f108d59
temporarily turn off rxdmod_tests group
nrnhines Jan 26, 2025
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
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ jobs:
39) pyenv_py_ver="3.9.1" ;;
310) pyenv_py_ver="3.10.1" ;;
311) pyenv_py_ver="3.11.0" ;;
312) pyenv_py_ver="3.12.0" ;;
313) pyenv_py_ver="3.13.1" ;;
*) echo "Error: pyenv python version not specified!" && exit 1;;
esac

Expand Down Expand Up @@ -110,5 +112,5 @@ workflows:
- manylinux2014-aarch64:
matrix:
parameters:
NRN_PYTHON_VERSION: ["37", "38", "39", "310", "311"]
NRN_PYTHON_VERSION: ["37", "38", "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 @@ -21,7 +21,7 @@ on:

env:
PY_MIN_VERSION: '3.7'
PY_MAX_VERSION: '3.11'
PY_MAX_VERSION: '3.13'

jobs:
coverage:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/neuron-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ on:
env:
BUILD_TYPE: Release
DESIRED_CMAKE_VERSION: 3.15.0
PY_MIN_VERSION: '3.7'
PY_MAX_VERSION: '3.11'
PY_MIN_VERSION: '3.9'
PY_MAX_VERSION: '3.13'

jobs:
ci:
Expand All @@ -40,12 +40,12 @@ jobs:
BUILD_TYPE: Release
DESIRED_CMAKE_VERSION: 3.15.0
PY_MIN_VERSION: ${{ matrix.config.python_min_version || '3.8' }}
PY_MAX_VERSION: ${{ matrix.config.python_max_version || '3.11' }}
PY_MAX_VERSION: ${{ matrix.config.python_max_version || '3.12' }}
MUSIC_INSTALL_DIR: /opt/MUSIC

strategy:
matrix:
os: [ macOS-12, ubuntu-20.04]
os: [ macOS-13, ubuntu-20.04]
config:
- { matrix_eval : "CC=gcc-9 CXX=g++-9", build_mode: "setuptools"}
- { matrix_eval : "CC=gcc-8 CXX=g++-8", build_mode: "cmake", music: ON}
Expand Down Expand Up @@ -148,15 +148,15 @@ jobs:
run: |
python3 -m venv music-venv
source music-venv/bin/activate
python3 -m pip install mpi4py "cython<3" "numpy<2"
python3 -m pip install mpi4py "cython>=3" "numpy>=2"
sudo mkdir -p $MUSIC_INSTALL_DIR
sudo chown -R $USER $MUSIC_INSTALL_DIR
# Stable build: https://github.com/INCF/MUSIC/archive/refs/heads/switch-to-MPI-C-interface.zip @ f33b66ea9348888eed1761738ab48c23ffc8a0d0
curl -L -o MUSIC.zip https://codeload.github.com/INCF/MUSIC/zip/f33b66ea9348888eed1761738ab48c23ffc8a0d0
unzip MUSIC.zip && mv MUSIC-* MUSIC && cd MUSIC
./autogen.sh
# workaround for MUSIC on MacOS 12
if [[ "${{matrix.os}}" == "macOS-12" ]]; then
if [[ "${{matrix.os}}" == "macOS-13" ]]; then
MPI_CXXFLAGS="-g" MPI_CFLAGS="-g" MPI_LDFLAGS="-g" CC=mpicc CXX=mpicxx ./configure --with-python-sys-prefix --prefix=$MUSIC_INSTALL_DIR --disable-anysource
else
./configure --with-python-sys-prefix --prefix=$MUSIC_INSTALL_DIR --disable-anysource
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
url = https://github.com/neuronsimulator/iv.git
[submodule "external/coreneuron"]
path = external/coreneuron
url = https://github.com/BlueBrain/CoreNeuron.git
url = https://github.com/neuronsimulator/CoreNeuron.git
[submodule "external/catch2"]
path = external/catch2
url = https://github.com/catchorg/Catch2.git
Expand Down
8 changes: 7 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ stages:
python.version: '3.11'
Python312:
python.version: '3.12'
Python313:
python.version: '3.13'
steps:

# Secure files documentation:
Expand Down Expand Up @@ -86,7 +88,7 @@ stages:
- job: 'MacOSWheels'
timeoutInMinutes: 40
pool:
vmImage: 'macOS-12'
vmImage: 'macOS-13'
strategy:
matrix:
Python37:
Expand All @@ -113,6 +115,10 @@ stages:
python.version: '3.12'
python.org.version: '3.12.2'
python.installer.name: 'macos11.pkg'
Python313:
python.version: '3.13'
python.org.version: '3.13.1'
python.installer.name: 'macos11.pkg'

steps:

Expand Down
2 changes: 1 addition & 1 deletion bldnrnmacpkgcmake.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -ex

default_pythons="python3.8 python3.9 python3.10 python3.11 python3.12"
default_pythons="python3.8 python3.9 python3.10 python3.11 python3.12 python3.13"
# distribution built with
# bash bldnrnmacpkgcmake.sh
# without args, default are the pythons above.
Expand Down
6 changes: 3 additions & 3 deletions ci/win_build_cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export MSYSTEM_PREFIX=/mingw64
export PATH=/mingw64/bin:$PATH

# have compatible cython3
python3 -m pip install "cython<3"
python3 -m pip install "cython>=3"

# if BUILD_SOURCESDIRECTORY not available, use te root of the repo
if [ -z "$BUILD_SOURCESDIRECTORY" ]; then
Expand All @@ -29,9 +29,9 @@ cd $BUILD_SOURCESDIRECTORY/build
-DNRN_ENABLE_PYTHON=ON \
-DNRN_ENABLE_RX3D=ON \
-DNRN_RX3D_OPT_LEVEL=2 \
-DPYTHON_EXECUTABLE=/c/Python37/python.exe \
-DPYTHON_EXECUTABLE=/c/Python311/python.exe \
-DNRN_ENABLE_PYTHON_DYNAMIC=ON \
-DNRN_PYTHON_DYNAMIC='c:/Python37/python.exe;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;c:/Python313/python.exe' \
-DCMAKE_INSTALL_PREFIX='/c/nrn-install' \
-DMPI_CXX_LIB_NAMES:STRING=msmpi \
-DMPI_C_LIB_NAMES:STRING=msmpi \
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 @@ -9,6 +9,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.1/python-3.13.1-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
18 changes: 6 additions & 12 deletions ci/win_install_deps.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,29 @@
:: install all dependencies

:: install python
python-3.7.exe /passive Include_pip=1 Include_test=0 PrependPath=1 DefaultJustForMeTargetDir=C:\Python37 || goto :error
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
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:\Python37\Lib\distutils\cygwinccompiler.py) -replace 'elif msc_ver == ''1600'':', 'elif msc_ver == ''1900'':' | Out-File C:\Python37\Lib\distutils\cygwinccompiler.py"
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:\Python37\Lib\distutils\cygwinccompiler.py) -replace 'msvcr100', 'msvcrt' | Out-File C:\Python37\Lib\distutils\cygwinccompiler.py"
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:\Python37\python.exe -m pip install numpy==1.14.6 "cython < 3" || goto :error
C:\Python38\python.exe -m pip install numpy==1.17.5 "cython < 3" || goto :error
C:\Python39\python.exe -m pip install numpy==1.19.3 "cython < 3" || goto :error
C:\Python310\python.exe -m pip install numpy==1.21.3 "cython < 3" || goto :error
C:\Python311\python.exe -m pip install numpy==1.23.5 "cython < 3" || goto :error
C:\Python312\python.exe -m pip install numpy==1.26.3 "cython < 3" || 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
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

Expand Down
3 changes: 2 additions & 1 deletion ci/win_test_installer.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ 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 numpy dependency
python -m pip install "numpy<2"
python -m pip install "numpy"
:: run also using whatever is system python
python --version
python -c "import neuron; neuron.test(); quit()" || set "errorfound=y"
Expand Down
3 changes: 2 additions & 1 deletion ci/win_test_installer_wo_rxd.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ 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 numpy dependency
python -m pip install "numpy<2"
python -m pip install "numpy"
:: run also using whatever is system python
python --version
python -c "import neuron; neuron.test(); quit()" || set "errorfound=y"
Expand Down
5 changes: 5 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# NEURON 8.2

## 8.2.7
_Release Date_ : 01-02-2025

This release allows use of Python 3.13

## 8.2.6
_Release Date_ : 24-07-2024

Expand Down
2 changes: 1 addition & 1 deletion docs/docs_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ bokeh<3
# do not check import of next line
ipython
plotnine
numpy<2
numpy
plotly
nbsphinx
jinja2
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Installation

pip3 install neuron

Alternatively, you can use the `PKG installer <https://github.com/neuronsimulator/nrn/releases/download/8.2.6/nrn-8.2.6-macosx-10.9-universal2-py-38-39-310-311-312.pkg>`_.
Alternatively, you can use the `PKG installer <https://github.com/neuronsimulator/nrn/releases/download/8.2.6/nrn-8.2.6-macosx-10.9-universal2-py-38-39-310-311-312-313.pkg>`_.

For troubleshooting, see the `detailed installation instructions <install/install_instructions.html>`_.

Expand Down
2 changes: 1 addition & 1 deletion docs/install/mac_pkg.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ cmake .. -DCMAKE_INSTALL_PREFIX=$NRN_INSTALL \

The default variables above will be
```
pythons="python3.9;python3.10;python3.11;python3.12"
pythons="python3.9;python3.10;python3.11;python3.12;python3.13"
archs_cmake='-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64'
```

Expand Down
4 changes: 2 additions & 2 deletions nrn_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ matplotlib
# bokeh 3 seems to break docs notebooks
bokeh<3
ipython
cython<3
cython
packaging
pytest
pytest-cov
mpi4py
numpy<2
numpy
2 changes: 1 addition & 1 deletion packaging/python/build_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
cython<3
cython
packaging
16 changes: 7 additions & 9 deletions packaging/python/build_wheels.bash
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,17 @@ pip_numpy_install() {
# numpy is special as we want the minimum wheel version
numpy_ver="numpy"
case "$py_ver" in
36) numpy_ver="numpy==1.12.1" ;;
37) numpy_ver="numpy==1.14.6" ;;
38) numpy_ver="numpy==1.17.5" ;;
39) numpy_ver="numpy==1.19.3" ;;
310) numpy_ver="numpy==1.21.3" ;;
311) numpy_ver="numpy==1.23.5" ;;
312) numpy_ver="numpy==1.26.0" ;;
39) numpy_ver="numpy>=2" ;;
310) numpy_ver="numpy>=2" ;;
311) numpy_ver="numpy>=2" ;;
312) numpy_ver="numpy>=2" ;;
313) numpy_ver="numpy>=2" ;;
*) echo "Error: numpy version not specified for this python!" && exit 1;;
esac

# older version for apple m1 as building from source fails
if [[ `uname -m` == 'arm64' ]] && [[ $py_ver != 311 ]] && [[ $py_ver != 312 ]]; then
numpy_ver="numpy==1.21.3"
if [[ `uname -m` == 'arm64' ]] && [[ $py_ver -le 311 ]] ; then
numpy_ver="numpy>=2"
fi

echo " - pip install $numpy_ver"
Expand Down
2 changes: 1 addition & 1 deletion packaging/python/test_wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ $python_exe -m pip install --upgrade setuptools
# install numpy, pytest and neuron
# we install setuptools because since python 3.12 it is no more installed
# by default
$python_exe -m pip install "numpy<2" pytest setuptools
$python_exe -m pip install "numpy" pytest setuptools
$python_exe -m pip install $python_wheel
$python_exe -m pip show neuron \
|| $python_exe -m pip show neuron-nightly \
Expand Down
32 changes: 20 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,12 @@ def setup_package():
NRN_COLLECT_DIRS = ["bin", "lib", "include", "share"]

docs_require = [] # sphinx, themes, etc
maybe_rxd_reqs = ["numpy<2", "Cython<3"] if Components.RX3D else []
ver_lt_313 = sys.version_info[0] == 3 and sys.version_info[1] < 13
if Components.RX3D:
if ver_lt_313:
maybe_rxd_reqs = ["numpy", "Cython"]
else:
maybe_rxd_reqs = ["numpy", "Cython"]
maybe_docs = docs_require if "docs" in sys.argv else []
maybe_test_runner = ["pytest-runner"] if "test" in sys.argv else []

Expand Down Expand Up @@ -574,7 +579,7 @@ def setup_package():
],
cmdclass=dict(build_ext=CMakeAugmentedBuilder, docs=Docs),
install_requires=[
"numpy>=1.9.3,<2",
"numpy",
"packaging",
"find_libpython",
"setuptools",
Expand Down Expand Up @@ -608,18 +613,21 @@ def mac_osx_setenv():
def fmt(version):
return ".".join(str(x) for x in version)

# Match Python OSX framework
py_osx_framework = extract_macosx_min_system_version(sys.executable)

if "MACOSX_DEPLOYMENT_TARGET" in os.environ:
# Don't override the value if it is set explicitly, but try and print a
# helpful message
explicit_target = tuple(
int(x) for x in os.environ["MACOSX_DEPLOYMENT_TARGET"].split(".")
)
else:
explicit_target = (10, 9)

# Match Python OSX framework
py_osx_framework = extract_macosx_min_system_version(sys.executable)
if py_osx_framework is None:
py_osx_framework = [10, 9]
if py_osx_framework[1] > 9:
py_osx_framework = (10, 9)
if py_osx_framework > (10, 9):
logging.warning(
"[ WARNING ] You are building a wheel with a Python built"
" for a recent MACOS version (from brew?). Your wheel won't be portable."
Expand All @@ -636,14 +644,14 @@ def fmt(version):
# Python framework, or 10.9 if the version targeted by the framework
# cannot be determined
if py_osx_framework is None:
py_osx_framework = (10, 15)
if py_osx_framework < (10, 15):
py_osx_framework = (10, 9)
if py_osx_framework < (10, 9):
logging.warning(
"C++17 support is required to build NEURON on macOS, "
"therefore minimum MACOSX_DEPLOYMENT_TARGET version is 10.15."
"C++11 support is required to build NEURON on macOS, "
"therefore minimum MACOSX_DEPLOYMENT_TARGET version is 10.9."
)
py_osx_framework = (10, 15)
if py_osx_framework > (10, 15):
py_osx_framework = (10, 9)
if py_osx_framework > (10, 9):
logging.warning(
"You are building a wheel with a Python built for macOS >={}. "
"Your wheel won't run on older versions, consider using an "
Expand Down
5 changes: 4 additions & 1 deletion src/nrnpython/nrnpy_hoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1596,13 +1596,16 @@ PyObject* nrnpy_forall(PyObject* self, PyObject* args) {
static PyObject* hocobj_iter(PyObject* self) {
// printf("hocobj_iter %p\n", self);
PyHocObject* po = (PyHocObject*) self;
if (po->type_ == PyHoc::HocObject) {
if (po->type_ == PyHoc::HocObject || po->type_ == PyHoc::HocSectionListIterator) {
if (po->ho_->ctemplate == hoc_vec_template_) {
return PySeqIter_New(self);
} else if (po->ho_->ctemplate == hoc_list_template_) {
return PySeqIter_New(self);
} else if (po->ho_->ctemplate == hoc_sectionlist_template_) {
// need a clone of self so nested loops do not share iteritem_
// The HocSectionListIter arm of the outer 'if' became necessary
// at Python-3.13.1 upon which the following body is executed
// twice. See https://github.com/python/cpython/issues/127682
PyObject* po2 = nrnpy_ho2po(po->ho_);
PyHocObject* pho2 = (PyHocObject*) po2;
pho2->type_ = PyHoc::HocSectionListIterator;
Expand Down
Loading
Loading