-
Notifications
You must be signed in to change notification settings - Fork 3
PyPI Publishing
Greg Annandale edited this page Jan 29, 2024
·
2 revisions
- Log in to both https://test.pypi.org/ and https://pypi.org/
- Generate API tokens for each (use your name for the token name)
- Create
~/.pypirc
and place into it the following (pasting in the tokens from the step above):
[pypi]
username = __token__
password = pypi-AgEIcH...
[testpypi]
username = __token__
password = pypi-AgENdG...
- Ensure the package version is bumped up as appropriate.
- Check correct Python version is installed:
asdf install
- Install requirements:
pip install wheel
andpip install twine
- Build:
python setup.py sdist bdist_wheel
- Test the build:
python3 -m twine check dist/*
- Upload to PyPI Test:
python3 -m twine upload --repository testpypi dist/*
- Check the package at the URL supplied
- Upload to PyPI:
python3 -m twine upload dist/*