A core developer should use the following steps to create a release X.Y.Z of ninja-python-distributions on PyPI.
This is usually done after :ref:`updating_ninja_version`.
- All CI tests are passing on GitHub Actions.
- You have a GPG signing key.
The commands reported below should be evaluated in the same terminal session.
Commands to evaluate starts with a dollar sign. For example:
$ echo "Hello" Hello
means that echo "Hello"
should be copied and evaluated in the terminal.
First, register for an account on PyPI.
If not already the case, ask to be added as a
Package Index Maintainer
.Create a
~/.pypirc
file with your login credentials:[distutils] index-servers = pypi pypitest [pypi] username=<your-username> password=<your-password> [pypitest] repository=https://test.pypi.org/legacy/ username=<your-username> password=<your-password>
where<your-username>
and<your-password>
correspond to your PyPI account.
PyPI: Step-by-step
- Make sure that all CI tests are passing on GitHub Actions.
- Download the latest sources
$ cd /tmp && \ git clone git@github.com:scikit-build/ninja-python-distributions ninja-python-distributions-release && \ cd ninja-python-distributions-release
- List all tags sorted by version
$ git fetch --tags && \ git tag -l | sort -V
- Choose the next release version number
$ release=X.Y.ZWarning
To ensure the packages are uploaded on PyPI, tags must match this regular expression:
^[0-9]+(\.[0-9]+)*(\.post[0-9]+)?$
.
- In README.rst, update PyPI download count after running
pypistats overall ninja
and commit the changes.
$ git add README.rst && \ git commit -m "README: Update download stats"Note
To learn more about pypistats, see https://pypi.org/project/pypistats/
- Tag the release
$ git tag --sign -m "ninja-python-distributions ${release}" ${release} masterWarning
We recommend using a GPG signing key to sign the tag.
- Publish the release tag
$ git push origin ${release}Note
This will trigger builds on each CI services and automatically upload the wheels and source distribution on PyPI.
- Check the status of the builds on GitHub Actions.
- Once the builds are completed, check that the distributions are available on PyPI.
- Create a clean testing environment to test the installation
$ pushd $(mktemp -d) && \ mkvirtualenv ninja-${release}-install-test && \ pip install ninja && \ ninja --versionNote
If the
mkvirtualenv
command is not available, this means you do not have virtualenvwrapper installed, in that case, you could either install it or directly use virtualenv or venv.
- Cleanup
$ popd && \ deactivate && \ rm -rf dist/* && \ rmvirtualenv ninja-${release}-install-test
- Publish master branch
$ git push origin master