Skip to main content

Step 11: Publish to PyPI

Publishing your plugin to PyPI makes it is easily installable for other people.

Explanation

The Python Package Index (PyPI) is the repository of packages that can be installed when you run pip install and poetry add. As previouly said, poetry greatly facilitates publishing to PyPI. So much so, that all packages from the parsomics project are published using it.

Hands on

Setting up poetry

  1. Head to pypi.org and create an account, if you don't have one already.

  2. Go to your account settings and create an API token. The token will only be shown once, so make sure you save it somewhere secure (i.e. an encrypted password manager).

  3. Configure poetry to use your API token:

    poetry config pypi-token.pypi <your-token>

Read the poetry documentation for more details on setting up your PyPI credentials.

Publishing the first version of your plugin

  1. Publish the current version of the plugin with poetry:

    poetry publish --build

Publishing new versions of your plugin

  1. To publish updates to your plugin in PyPI using poetry, you need to create a new version of your plugin. To do that, change the version string in the pyproject.toml file.

    [tool.isort]
    profile = "black"

    [tool.poetry.group.dev.dependencies]
    black = "^25.1.0"
    isort = "^6.0.1"

    [project]
    name = "parsomics-plugin-interpro"
    version = "0.1.1" # <--- increase the version number to publish updates
    #...

    This string should follow the conventions of semantic versioning. You can read more about this in the general development conventions of the parsomics project.

  2. Stage pyproject.toml and commit it. Your commit message should look like:

    packaging: bump version to v0.1.1
  3. Add a git tag to the version:

    git tag v0.1.1 -m "v0.1.1"
  4. Publish the new version of the plugin with poetry:

    poetry publish --build