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

Pyproject migration #2832

Draft
wants to merge 15 commits into
base: master
Choose a base branch
from
13 changes: 2 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,8 @@ jobs:
- run:
name: Build manylinux AArch64 wheel
command: |
docker run --rm \
-w /root/nrn \
-v $PWD:/root/nrn \
-v /opt/nrnwheel/mpt:/nrnwheel/mpt \
-e NEURON_NIGHTLY_TAG \
-e NRN_NIGHTLY_UPLOAD \
-e NRN_RELEASE_UPLOAD \
-e SETUPTOOLS_SCM_PRETEND_VERSION \
-e NRN_BUILD_FOR_UPLOAD=1 \
'neuronsimulator/neuron_wheel:latest-gcc9-aarch64' \
packaging/python/build_wheels.bash linux << parameters.NRN_PYTHON_VERSION >> coreneuron
python3 -m pip install cibuilwheel
CIBW_BUILD="cp${NRN_PYTHON_VERSION}*" cibuildwheel

- store_artifacts:
path: ./wheelhouse
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,13 @@ jobs:
working-directory: ${{runner.workspace}}/nrn
run: |
echo "-------- NEURON wheel --------";
python setup.py build_ext bdist_wheel;
neuron_wheel=dist/NEURON*.whl;
python -m pip install cibuildwheel
CIBW_BUILD="cp311*" cibuildwheel
neuron_wheel=wheelhouse/NEURON*.whl;
echo "-------- install wheel --------"
python -m pip install $neuron_wheel;
echo "-------- now build docs--------";
python setup.py docs;
python _setup.py docs;
echo "-------- disable jekyll--------";
pushd docs/_build;
touch .nojekyll;
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/neuron-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,10 @@ jobs:
echo nrn-enable-sanitizer not found, not using it
fi
elif [[ "$BUILD_MODE" == "setuptools" ]]; then
./packaging/python/build_wheels.bash CI;
python3 -m pip install cibuildwheel
CIBW_BUILD="cp311*" cibuildwheel
fi;

if [[ -z "${nrn_enable_sanitizer_preload_python}" ]]; then
nrn_enable_sanitizer_preload_python="${PYTHON}"
fi
Expand Down Expand Up @@ -393,7 +395,7 @@ jobs:
fi;

if [ "$BUILD_MODE" == "setuptools" ]; then
neuron_wheel=wheelhouse/NEURON*.whl;
neuron_wheel=wheelhouse/*.whl;
# test with virtual environment
./packaging/python/test_wheels.sh $PYTHON $neuron_wheel
# test with global installation
Expand Down
8 changes: 0 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -809,14 +809,6 @@ if(NRN_ENABLE_TESTS)
include(Catch)
endif()
include(CTest)
if(NRN_ENABLE_PYTHON)
# Need this for *all* Python versions we try and run tests with
nrn_find_python_module(MODULE pytest ALL REQUIRED)
nrn_find_python_module(MODULE pytest_cov ALL)
if(NOT PYTEST_COV_FOUND)
message(STATUS "pytest-cov package not installed. Python coverage will not be generated.")
endif()
endif()
add_dependencies(nrniv_lib copy_share_demo_to_build)
# Execute neurondemo as part of the build because it lazily calls nrnivmodl. If we don't do this
# then test_neurondemo.py will run nrnivmodl in a clean build, and report compilation warnings as
Expand Down
File renamed without changes.
65 changes: 9 additions & 56 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,9 @@ stages:
timeoutInMinutes: 45
pool:
vmImage: 'ubuntu-20.04'
strategy:
matrix:
Python38:
python.version: '3.8'
Python39:
python.version: '3.9'
Python310:
python.version: '3.10'
Python311:
python.version: '3.11'
Python312:
python.version: '3.12'
steps:

- task: UsePythonVersion@0
# Secure files documentation:
# https://docs.microsoft.com/en-us/azure/devops/pipelines/library/secure-files?view=azure-devops
# NOTE: when uploading new secure files, access must be permitted from the Azure pipeline interface (check message there)
Expand All @@ -58,19 +47,8 @@ stages:
# Note that mpt headers must be mounted in the docker imager under `/nrnwheel/mpt`
# This path is checked by `packaging/python/build_wheels.bash` when run in the image.
- script: |
sudo mkdir -p /opt/nrnwheel/mpt
sudo tar -zxf $(mpt_headersSF.secureFilePath) --directory /opt/nrnwheel/mpt
docker run --rm \
-w /root/nrn \
-v $PWD:/root/nrn \
-v /opt/nrnwheel/mpt:/nrnwheel/mpt \
-e NEURON_NIGHTLY_TAG \
-e NRN_NIGHTLY_UPLOAD \
-e NRN_RELEASE_UPLOAD \
-e SETUPTOOLS_SCM_PRETEND_VERSION \
-e NRN_BUILD_FOR_UPLOAD=1 \
'neuronsimulator/neuron_wheel:latest-x86_64' \
packaging/python/build_wheels.bash linux $(python.version) coreneuron
python3 -m pip install cibuildwheel
CIBW_BUILD='cp311*' cibuildwheel
displayName: 'Building ManyLinux Wheel'

- script: |
Expand All @@ -86,38 +64,9 @@ stages:
timeoutInMinutes: 60
pool:
vmImage: 'macOS-12'
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'
python.installer.name: 'macos11.pkg'
Python310:
python.version: '3.10'
python.org.version: '3.10.11'
python.installer.name: 'macos11.pkg'
Python311:
python.version: '3.11'
python.org.version: '3.11.7'
python.installer.name: 'macos11.pkg'
Python312:
python.version: '3.12'
python.org.version: '3.12.0'
python.installer.name: 'macos11.pkg'

steps:

- script: |
installer=python-$(python.org.version)-$(python.installer.name)
url=https://www.python.org/ftp/python/$(python.org.version)/$installer
curl $url -o $installer
sudo installer -pkg $installer -target /
displayName: 'Install Python from python.org'

- script: |
brew install --cask xquartz
brew install flex bison mpich
Expand All @@ -128,6 +77,7 @@ stages:
brew uninstall --ignore-dependencies libomp || echo "libomp doesn't exist"
displayName: 'Install OSX System Dependencies'

- task: UsePythonVersion@0
# readline has been manually built with ncurses and MACOSX_DEPLOYMENT_TARGET=10.9 and stored as secure file on Azure.
# See `packaging/python/Dockerfile` for build instructions.
#
Expand All @@ -145,12 +95,15 @@ stages:
# seems that 10.15 is actually needed for std::filesystem::path.
- script: |
export MACOSX_DEPLOYMENT_TARGET=10.15
export PATH=/usr/local/opt/flex/bin:/usr/local/opt/bison/bin:$PATH
export BREW_PREFIX=$(brew --prefix)
export PATH=${BREW_PREFIX}/opt/flex/bin:${BREW_PREFIX}/opt/bison/bin:$PATH
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
export NRN_BUILD_FOR_UPLOAD=1
sudo mkdir /opt/nrnwheel
sudo tar -zxf $(readlineSF.secureFilePath) --directory /opt/nrnwheel/
packaging/python/build_wheels.bash osx $(python.version) coreneuron
export MPI_INCLUDE_HEADERS="${BREW_PREFIX}/opt/openmpi/include;${BREW_PREFIX}/opt/mpich/include"
python3 -m pip install cibuildwheel
CIBW_BUILD='cp311*' cibuildwheel
displayName: 'Build MacOS Wheel'

- template: ci/azure-wheel-test-upload.yml
Expand Down
46 changes: 0 additions & 46 deletions build_osx_wheels.sh

This file was deleted.