Build and publish to pypi - genotoul-bioinfo/dgenies GitHub Wiki

Building distribution archive

We simply follow python packaging guidelines

We install first the lastest PyPA build package

python3 -m pip install --upgrade build

We go then to the D-genies project root, where lies the pyproject.toml file, and build the python package.

python3 -m build

It will produces two files in the dist directory

dist/
├── dgenies-<version>-py3-none-any.whl
└── dgenies-<version>.tar.gz

Sign the packages

If you don't have a gpg key yet, create it:

gpg --gen-key

Then, sign the packages

gpg --detach-sign -a dist/dgenies-<version>.tar.gz
gpg --detach-sign -a dist/dgenies-<version>.whl

Upload the distribution archives to test.pypi

Again, we follow python packaging guidelines

We install first the latest twine package

python3 -m pip install --upgrade twine

We upload then the dist packages to the test repository.

Note: Pay attention to how to customize your ~/.pypirc file in order to manage your authentication (tokens and passwords) on test.pypi.org

python3 -m twine upload --repository testpypi \
    dist/dgenies-<version>.tar.gz \
    dist/dgenies-<version>.tar.gz.asc \
    dist/dgenies-<version>-py3-none-any.whl \
    dist/dgenies-<version>-py3-none-any.whl.asc

We then install the package from test repository:

python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps dgenies

If everything is good, we finally upload the packages to the pypi repository.

Upload the distribution archives to pypi

Note: Again, pay attention to how to customize your ~/.pypirc file in order to manage your authentication (tokens and passwords) on pypi.org

python3 -m twine upload \
    dist/dgenies-<version>.tar.gz \
    dist/dgenies-<version>.tar.gz.asc \
    dist/dgenies-<version>-py3-none-any.whl \
    dist/dgenies-<version>-py3-none-any.whl.asc
⚠️ **GitHub.com Fallback** ⚠️