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 1 commit
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
Prev Previous commit
Next Next commit
Revert "adopt wholesale the files in master ci folder into 8.2"
This reverts commit 9d9f281.
  • Loading branch information
nrnhines committed Jan 23, 2025
commit 81f0d95afb838c3e87bf1e1dfa8a11744dae0bec
32 changes: 27 additions & 5 deletions ci/azure-wheel-test-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ steps:
brew install python
export SKIP_EMBEDED_PYTHON_TEST=true
packaging/python/test_wheels.sh /usr/local/bin/python3 wheelhouse/*.whl
condition: and(eq(variables['agent.os'], 'Darwin'), eq(variables['python.version'], '3.8'))
condition: and(eq(variables['agent.os'], 'Darwin'), eq(variables['python.version'], '3.7'))
displayName: 'Test with brew Python'

- task: UsePythonVersion@0
Expand All @@ -24,21 +24,43 @@ steps:
- task: TwineAuthenticate@1
inputs:
pythonUploadServiceConnection: AzureNeuronPypiNightly
condition: and(succeeded(), in(variables['Build.Reason'], 'Manual', 'Schedule'), ne(variables['NRN_NIGHTLY_UPLOAD'], 'false'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
condition: and(succeeded(), in(variables['Build.Reason'], 'Manual', 'Schedule'), ne(variables.GPU_BUILD, 'true'), ne(variables['NRN_NIGHTLY_UPLOAD'], 'false'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))

- script: |
python -m pip install twine
python -m twine upload --verbose --skip-existing -r NeuronPypiNightly --config-file $(PYPIRC_PATH) wheelhouse/*.whl
condition: and(succeeded(), in(variables['Build.Reason'], 'Manual', 'Schedule'), ne(variables['NRN_NIGHTLY_UPLOAD'], 'false'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
condition: and(succeeded(), in(variables['Build.Reason'], 'Manual', 'Schedule'), ne(variables.GPU_BUILD, 'true'), ne(variables['NRN_NIGHTLY_UPLOAD'], 'false'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
displayName: 'Upload nightly wheel to pypi.org'

- task: TwineAuthenticate@1
inputs:
pythonUploadServiceConnection: AzureNeuronGpuPypiNightly
condition: and(succeeded(), in(variables['Build.Reason'], 'Manual', 'Schedule'), eq(variables.GPU_BUILD, 'true'), ne(variables['NRN_NIGHTLY_UPLOAD'], 'false'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))

- script: |
python -m pip install twine
python -m twine upload --verbose --skip-existing -r NeuronGpuPypiNightly --config-file $(PYPIRC_PATH) wheelhouse/*.whl
condition: and(succeeded(), in(variables['Build.Reason'], 'Manual', 'Schedule'), eq(variables.GPU_BUILD, 'true'), ne(variables['NRN_NIGHTLY_UPLOAD'], 'false'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
displayName: 'Upload nightly GPU wheel to pypi.org'

- task: TwineAuthenticate@1
inputs:
pythonUploadServiceConnection: AzureNeuronPypi
condition: and(succeeded(), in(variables['Build.Reason'], 'Manual'), eq(variables['NRN_RELEASE_UPLOAD'], 'true'))
condition: and(succeeded(), in(variables['Build.Reason'], 'Manual'), ne(variables.GPU_BUILD, 'true'), eq(variables['NRN_RELEASE_UPLOAD'], 'true'))

- script: |
python -m pip install twine
python -m twine upload --verbose --skip-existing -r NeuronPypi --config-file $(PYPIRC_PATH) wheelhouse/*.whl
condition: and(succeeded(), in(variables['Build.Reason'], 'Manual'), eq(variables['NRN_RELEASE_UPLOAD'], 'true'))
condition: and(succeeded(), in(variables['Build.Reason'], 'Manual'), ne(variables.GPU_BUILD, 'true'), eq(variables['NRN_RELEASE_UPLOAD'], 'true'))
displayName: 'Upload release wheel to pypi.org'

- task: TwineAuthenticate@1
inputs:
pythonUploadServiceConnection: AzureNeuronGpuPypi
condition: and(succeeded(), in(variables['Build.Reason'], 'Manual'), eq(variables.GPU_BUILD, 'true'), eq(variables['NRN_RELEASE_UPLOAD'], 'true'))

- script: |
python -m pip install twine
python -m twine upload --verbose --skip-existing -r NeuronGpuPypiProj --config-file $(PYPIRC_PATH) wheelhouse/*.whl
condition: and(succeeded(), in(variables['Build.Reason'], 'Manual'), eq(variables.GPU_BUILD, 'true'), eq(variables['NRN_RELEASE_UPLOAD'], 'true'))
displayName: 'Upload release GPU wheel to pypi.org'
46 changes: 46 additions & 0 deletions ci/azure-win-installer-upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
steps:

- task: PublishBuildArtifacts@1
inputs:
pathToPublish: '$(Build.SourcesDirectory)\nrn-nightly-AMD64.exe'
displayName: 'Publish windows installer as build artifact'

- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
displayName: "Use System Python"

- task: BatchScript@1
inputs:
filename: ci/win_install_neuron.cmd
displayName: "Run Installer and launch .hoc association test"
condition: succeeded()

- task: BatchScript@1
inputs:
# temporarily disable rxd testing ( ci/win_test_installer.cmd <-> ci/win_test_installer_wo_rxd.cmd)
# see https://github.com/neuronsimulator/nrn/issues/1522
filename: ci/win_test_installer_wo_rxd.cmd
displayName: "Test Installer"
condition: succeeded()

- task: GithubRelease@0
inputs:
gitHubConnection: neuronsimulator-installers
repositoryName: neuronsimulator/installers
action: edit
# note : if previous release doesn't exist, as we are pushing
# to different repository, we must need to provide commit id.
target: '9d7b1e26717bd207f7ae6114f78f7ab7b958c998'
tagSource: manual
tag: nightly
title: 'Nightly NEURON Developer Snapshot'
releaseNotesSource: input
releaseNotes: "Last NEURON Commit: $(Build.SourceVersionMessage)"
isPreRelease: true
assetUploadMode: replace
addChangeLog: false
assets: |
$(Build.SourcesDirectory)\nrn-nightly-AMD64.exe
displayName: 'Upload installer to GitHub'
condition: and(succeeded(), in(variables['Build.Reason'], 'Manual', 'Schedule'))
3 changes: 2 additions & 1 deletion ci/win_download_deps.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
:: download all installers

:: python
pwsh -command Invoke-WebRequest -MaximumRetryCount 4 -OutFile python-3.7.exe https://www.python.org/ftp/python/3.7.7/python-3.7.7-amd64.exe || goto :error
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
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
2 changes: 1 addition & 1 deletion ci/win_install_neuron.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ tree /F C:\nrn_test\lib\python

:: Test of association with hoc files. This test is very tricky to handle. We do it in two steps
:: 1st step -> launch association.hoc here and test the output in another step
start /B /wait /REALTIME %cd%\ci\association.hoc
start /wait /REALTIME %cd%\ci\association.hoc
80 changes: 80 additions & 0 deletions ci/win_test_installer_wo_rxd.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
:: temporarily disable rxd testing ( ci/win_test_installer.cmd <-> ci/win_test_installer_wo_rxd.cmd)
:: see https://github.com/neuronsimulator/nrn/issues/1522

@echo on

:: error variable
set "errorfound="

:: setup environment
set PATH=C:\nrn_test\bin;%PATH%
set PYTHONPATH=C:\nrn_test\lib\python;%PYTHONPATH%
set NEURONHOME=C:\nrn_test

echo %PATH%
echo %PYTHONPATH%
echo %NEURONHOME%

:: Mitigation strategy -> for reasons uknown(thank you Windows), association.hoc.out may not be generated from previous step.
:: If so, try again to generate it. No wait required like previous strategies, we rely on testing entropy from this point on.
if not exist association.hoc.out (start /wait /REALTIME %cd%\ci\association.hoc)

:: test all pythons
C:\Python37\python -c "import neuron; neuron.test(); quit()" || set "errorfound=y"
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 numpy dependency
python -m pip install "numpy<2"
:: run also using whatever is system python
python --version
python -c "import neuron; neuron.test(); quit()" || set "errorfound=y"

:: test python and nrniv
python -c "from neuron import h; s = h.Section(); s.insert('hh'); quit()" || set "errorfound=y"
nrniv -python -c "from neuron import h; s = h.Section(); s.insert('hh'); quit()" || set "errorfound=y"

:: test mpi
mpiexec -n 2 nrniv %cd%\src\parallel\test0.hoc -mpi || set "errorfound=y"
mpiexec -n 2 python %cd%\src\parallel\test0.py -mpi --expected-hosts 2 || set "errorfound=y"

:: setup for mknrndll/nrnivmodl
set N=C:\nrn_test
set PATH=C:\nrn_test\mingw\usr\bin;%PATH%

:: test mknrndll
copy /A share\examples\nrniv\nmodl\cacum.mod .
C:\nrn_test\mingw\usr\bin\bash -c "mknrndll" || set "errorfound=y"
python -c "import neuron; from neuron import h; s = h.Section(); s.insert('cacum'); print('cacum inserted'); quit()" || set "errorfound=y"

:: test nrnivmodl
rm -f cacum* mod_func* nrnmech.dll
copy /A share\examples\nrniv\nmodl\cacum.mod .
call nrnivmodl
echo "nrnivmodl successfull"
python -c "import neuron; from neuron import h; s = h.Section(); s.insert('cacum'); print('cacum inserted'); quit()" || set "errorfound=y"

:: Test of association with hoc files. This test is very tricky to handle. We do it in two steps.
:: 2nd step -> check association.hoc output after we've launched 1step in previous CI step
cat association.hoc.out
findstr /i "^hello$" association.hoc.out || set "errorfound=y"

echo "All tests finished!"

:: uninstall neuron
C:\nrn_test\uninstall /S || set "errorfound=y"
echo "Uninstalled NEURON"

:: if something failed, exit with error
if defined errorfound (goto :error)

:: if all goes well, go to end
goto :EOF

:: something has failed, teminate with error code
:error
echo ERROR : exiting with error code 1 ..
exit 1
Loading