- Be inside the relevant virtualenv
- virtualenv has the latest
pip
,setuptools
,twine
andwheel
packages installed - Be inside the root of the relevant package
- Have a
.pypirc
file in~
(your home folder) that looks like:
[distutils]
index-servers = pypi
[pypi]
username = myuser
password = mypassword
- Make code changes and check if your tests are passing locally
- Commit and upload to GitHub
- Check on GitHub if there are any new Codacy problems*
- Fix Codacy problems, and if necessary repeat 2 and 3
- Check on GitHub if Travis build succeeds**
- Fix Travis problems, and if necessary repeat 2 and 5
- If everything looks good, we can bump the version in the
__init__.py
file and commit this. - Now we create a tag with the new version number:
git tag -a 0.1.0 -m "tag 0.1.0"
- Push to GitHub, making sure tags are also pushed:
git push --follow-tags
- Remove old builds from local
dist/
directory - Build packages with:
python setup.py sdist
- Double check if the resulting
.tar.gz
in/dist
contains all the necessary files in the package, and ifPKG-INFO
looks okay - Build wheel with:
python setup.py bdist_wheel --universal
- Upload to Pypi with:
twine upload dist/*
* Note that I'm using Codacy for keeping track of code quality. You can fill in in your preferred service, or ignore steps 3 and 4.
** Note that I'm using Travies as CI service. You can fill in in your preferred service, or ignore steps 5 and 6.