(Merret, 2022-07-21)
- Install twine:
pip install twine
- Create a pypirc file in your home dir:
vi ~/.pypirc
(see example below) - Login to pypi / test-pypi and create an API key to use for authentication, add that API key to the .pypirc file.
-
Make sure you are on master and master is up to date.
-
Go to the directory where the
setup.py
file is located. -
Remove the previous builds:
rm dist/pyhandle-x.y.z.tar.gz
-
Build the next build:
python setup.py sdist
-
Check with twine:
twine check dist/*
-
Upload with twine:
twine upload --repository pypi dist/*
[distutils]
index-servers =
pypi
testpypi
[pypi]
repository = https://upload.pypi.org/legacy/
username = __token__
password = pypi-Jhdsfjksdfk... (api key)
[testpypi]
repository = https://test.pypi.org/legacy/
username = __token__
password = pypi-KsdkfKJHksjdhfkjsdf... (api key)