Skip to content

PyPI release workflow

Alessandro Candido requested to merge AleCandido/lhapdf:main into main

For my convenience, it would be very comfortable to have an LHAPDF package available on PyPI. It would make it easier to install, and it would make it possible for other packages to depend on it.

Since I understand that packaging (and do it every time a new release is available) is not a pleasure, I'm providing here a workflow that will do it (almost) automatically (I put a "manual" trigger in the workflow file).

In many respects the workflow is similar to the one proposed in !12 (including a clash in the name, I decided to leave to someone else the pleasure to resolve). Of course in this case is packaging a binary distribution, built in a suitable container (provided by PyPA). The workflow is already working, and it has been deployed twice (first time manually, second with the GitLab pipeline) on https://test.pypi.org/project/LHAPDF/

It depends on a secret variable, for the time being named TEST_PYPI_TOKEN, to be replaced with PYPI_TOKEN after merge. Even the file wrappers/python/publish_wheels in his last line contains:

$PY -m twine upload $DEST/* --repository testpypi --skip-existing --verbose --username __token__ --password $PYPI_TOKEN

to be replaced with

$PY -m twine upload $DEST/* --skip-existing --verbose --username __token__ --password $PYPI_TOKEN

Metadata present in wrappers/python/setup.py.in have been slightly improved, but still they are rather incomplete.

Merge request reports