Skip to content
Tero Saarni edited this page Oct 26, 2024 · 7 revisions

Release instructions

Preparations

First, generate an API token for your account or project

  1. Go to https://pypi.org/manage/account/token/.
  2. Set Token name to pypi and select Scope Entire account.
  3. Click Create token and copy the token.
  4. 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

Upload release to testpypi

Testpypi is for testing the release process.

git reset --hard
flit publish --repository testpypi

Packages 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.

Upload release to pypi

Follow the steps to publish release to PyPi https://pypi.org/project/certy/.

  1. Make sure you are at main branch git status and the working directory is clean git reset --hard.
  2. Set the next version number in src/certy/__init__.py and commit the change git add src/certy/__init__.py && git commit -m "Release version x.y.z".
  3. Tag the release git tag vx.y.z
  4. Publish the release to pypi flit publish
  5. Check that the publish was successful at https://pypi.org/project/certy/#files
  6. Push changes git push && git push --tags
  7. 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.

Links

Clone this wiki locally