-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Tero Saarni edited this page Jun 12, 2025
·
8 revisions
First, generate an API token for your account or project
- Go to https://pypi.org/manage/account/token/.
- Set
Token nametopypiand selectScopeEntire account. - Click
Create tokenand copy the token. - Follow the instructions on the page to store the token in
~/.pypirc.
Here is an example of ~/.pypirc configuration file:
[distutils]
index-servers =
pypi
testpypi
[pypi]
username = __token__
password = <TOKEN>
[testpypi]
repository = https://test.pypi.org/legacy/
username = <USER>
Install dependencies for publishing:
python3 -m venv .venv
source .venv/bin/activate
pip install -r dev-requirements.txt
flit build
Testpypi is for testing the release process.
git reset --hard
flit publish --repository testpypiPackages can be deleted from test.pypi.org but NOT reuploaded with the same version. To delete, go to https://test.pypi.org/manage/projects/, click manage on package and delete.
When happy with the results, proceed with publishing to pypi.
Follow the steps to publish release to PyPi https://pypi.org/project/certy/.
- Make sure you are at
mainbranchgit statusand the working directory is cleangit reset --hard. - Set the next version number in
src/certy/__init__.pyand commit the changegit add src/certy/__init__.py && git commit -m "Release version x.y.z". - Tag the release
git tag vx.y.z - Publish the release to pypi
flit publish - Check that the publish was successful at https://pypi.org/project/certy/#files
- Push changes
git push && git push --tags - Create github release by submitting form at https://github.com/tsaarni/python-certy/releases/new.
For flit documentation for pyproject.toml see https://flit.pypa.io/en/stable/pyproject_toml.html.