neuronsimulator / nrn

NEURON Simulator
http://nrn.readthedocs.io
Other
403 stars 118 forks source link

[Instructions] How to upload wheels to pypi.org for new release? #877

Closed pramodk closed 3 years ago

pramodk commented 3 years ago

I am writing this information as issue. I will later moved this to documentation section:

Currently we have manual process to upload wheels to pypi.org. Note that once wheel is pushed to pypi.org, we can not edit/update the uploaded wheel. The only to change wheel is to upload new one with a new tag. So before executing below, make sure to run whole pipeline in test mode first. Once we make sure everything is working fine, then re-run pipeline to upload the wheels.

Step 1. Running pipeline for test purpose

image

image

image

image image image

image

This will create wheels that you can download and test locally:

image

Step 2. Running pipeline to upload wheels

Once wheels are created and tested, you can run pipeline as described above but with an additional variable: NRN_RELEASE_UPLOAD=true

image

i.e. we set following 3 variables:

Now we can run pipeline:

image

This will now create, test and upload wheels to pypi.org!

pramodk commented 3 years ago

In rare circumstances we might want to override version name generate in setup.py. For example, if one of the wheel fails to build, we might need to do a bug fix in the release branch and then upload wheel again.

In this case, some of the wheels are already uploaded and we can't override those. In this case, we can create new wheel with version line 7.8.2.1. NEURON_WHEEL_VERSION variable is used to do such version overriding in setup.py.

pramodk commented 2 years ago

This is how Apple M1 wheels were built on BBP laptop:


# build wheels
MACOSX_DEPLOYMENT_TARGET=11.0 NEURON_NIGHTLY_TAG= bash -x packaging/python/build_wheels.bash osx 3.8
MACOSX_DEPLOYMENT_TARGET=11.0 NEURON_NIGHTLY_TAG= bash -x packaging/python/build_wheels.bash osx 3.9
MACOSX_DEPLOYMENT_TARGET=11.0 NEURON_NIGHTLY_TAG= bash -x packaging/python/build_wheels.bash osx 3.10

# test wheel
SKIP_EMBEDED_PYTHON_TEST=true ./packaging/python/test_wheels.sh python3.9 wheelhouse/NEURON-8.1a0-cp39-cp39-macosx_11_0_arm64.whl

# upload wheel
pip install twine
twine upload NEURON-8.1a0-cp*