3. Release

These are the steps needed to release a new version of the package on PyPI.


3.1. Incrementing the Version

The version numbers follow the semantic versioning system, the specifications of which can be found here.

The setup.py file contains some metadata about the package including the version number which needs to be incremented.

Tag the commit which contains the final version of the code being released.

$ git tag -a v0.1.0 -m "Release Version 0.1.0" a029ac
$ git push origin --tags

3.2. Generating Distribution Archives

Install the latest versions of setuptools and wheel.

python -m pip install --user --upgrade setuptools wheel

Generate distribution archives.

$ python setup.py sdist bdist_wheel

There should now be two files in the dist directory.

3.3. Upload the Distribution Archives

Before uploading them to PyPI, first upload them to Test PyPI to ensure that everything has gone as intended.

Install Twine.

$ python -m pip install --user --upgrade twine

Upload all of the archives under dist to Test PyPI.

$ python -m twine upload --repository testpypi dist/*

Install the package to test it.

$ python -m pip install --index-url https://test.pypi.org/simple/ --no-deps racketinterpreter
$ python
>>> import racketinterpreter

Upload all of the archives under dist to PyPI.

$ python3 -m twine upload dist/*