-
-
Notifications
You must be signed in to change notification settings - Fork 62
How to deploy a new package (or version of package) to PyPI
Guillaume Chevalier edited this page Jan 16, 2020
·
7 revisions
You will need to have a ~/.pypirc
file that looks like that somehow, using your PyPI username once you have a PyPI account:
[distutils]
index-servers =
pypi
pypitest
[pypi]
repository: https://upload.pypi.org/legacy/
username: guillaume-chevalier
[pypitest]
repository: https://test.pypi.org/legacy/
username: guillaume-chevalier
- Ensure tests and status checks all pass in the master.
- Increment version number here so as to fit the next according milestone. Ensure the milestone is complete.
- Add a git tag like
git tag 0.1.0
on the commit to be released. - Remove the
iframe
and the sponsors' logo images in the README (because this will crash upon uploading to PyPI: HTML is not supported). - Upload to PyPI:
- Create package file:
python3 setup.py sdist bdist_wheel
- Test the upload:
twine upload -r pypitest dist/neuraxle-0.1.0.tar.gz
(note: change the version number) - Upload it for real if it worked:
twine upload -r pypi dist/neuraxle-0.1.0.tar.gz
- Create package file:
- Don't forget to push the git tag:
git push --tags
. Don't commit the temporary HTML removals that were done in the README, thought. - Ensure that the new version number on PyPI fits the uploaded one. Enjoy!
You can run this to clean your local repo of the build if you want:
rm -rf build/
rm -rf dist/
rm -rf neuraxle.egg-info/