-
-
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 Jul 22, 2022
·
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. The tag needs to be on a commit that is in the master. Otherwise, please open a pull request to master for it to be accepted. - 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
to the ORIGIN of the repo (not your own fork). You'll need admin priviledges for this. Don't commit the temporary HTML removals that were done in the README, thought. - Draft a new release here using the newly pushed tag, and using as release title the tag number. Ideally also add a description of the changes by checking what change in the corresponding milestone.
- Ensure that the new version number on PyPI fits the uploaded one. Enjoy!
You should run this to clean your local repo of the build to avoid any possible conflicts when deploying next:
rm -rf build/
rm -rf dist/
rm -rf .eggs/
rm -rf neuraxle.egg-info/
Also maintain this file such as incrementing version number: https://github.com/Neuraxio/staged-recipes/blob/master/recipes/neuraxle/meta.yaml
And open a PR to conda-forge's main repo, as explained here: https://conda-forge.org/