1. Create a pypi account at https://pypi.org/. (If you need a separate repo for testing, you can also create it at test.pypi.org
2. Setup 2-auth and get your API key information. Save your token somewhere if needed (only accessible once)
3. Setup auth locally in ~/.pypirc
[distutils]
index-servers =
pypi
testpypi
[pypi]
username = __token__
password = pypi-xxxxxxxxxxxx
[testpypi]
username = __token__
password = pypi-xxxxxxxxxxxx
# If pip not installed yet locally
4. pip install build twine
1. SETUPTOOLS_SCM_PRETEND_VERSION=<version> python -m build
2. twine upload --repository pypi dist/*
- With pypi, cannot do a version deployment like 1.5.0+custom1 because it doesn't follow their naming scheme. I've found this to be useful
when forking projects and following a convention to track what the state of the fork is while still following the original project.
- Get a 400 when trying to upload to twine due to project existing.
- Project already exist so we should upload a new version.
- Even if we manually delete the project, we'll still get a 400.