Notes on releasing a Python module.
This covers releasing a Python module through PYPI.
A new package release should have:
- A tagged release on Github
- A new uploaded release to PYPI (this is what pip uses)
- A new associated documentation build, reflecting the new version number
To release a new version of a tool, you will need an account on both PYPI and TestPYPI.
Uploading to PYPI:
- Build a distribution:
python setup.py sdist bdist_wheel
- Upload to PYPI (depends on a .pypirc file):
twine upload --repository pypi dist/*
Release Candidates You can use the version numbers to indicate candidate releases These are treated as pre-releases on PYPI - only installed if explicitly requested.
PyPA
'Python Packaging Authority'
A working group that manages projects for Python packaging.
PyPI
'Python Package Index'
A 'place'. It is a repository of Python software packages
https://pypi.org
Is also 'testpypi', a test instance of the PYPI repository
https://test.pypi.org/
pip
A tool (package) for installing Python packages. By default, gets things from PYPI.
twine
A utility (package) for publishing Python packages on PYPI.
Does the uploading step to PYPI.
https://twine.readthedocs.io/en/latest/
setuptools
A tool (package) for Python packaging.
https://setuptools.readthedocs.io/en/latest/
Some useful links:
- An overview of packaging, as an overview of preparing a package
- A guide for setting up and using the pypirc file
- pip vs. conda:
- Blog post on differences: https://jakevdp.github.io/blog/2016/08/25/conda-myths-and-misconceptions/
- conda-forge
- Semantic versioning: a specification for how to use meaningful version numbers