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
-
Head to pypi.org and create an account, if you don't have one already.
-
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).
-
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
-
Publish the current version of the plugin with
poetry
:poetry publish --build
Publishing new versions of your plugin
-
To publish updates to your plugin in PyPI using
poetry
, you need to create a new version of your plugin. To do that, change theversion
string in thepyproject.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. -
Stage
pyproject.toml
and commit it. Your commit message should look like:packaging: bump version to v0.1.1
-
Add a git tag to the version:
git tag v0.1.1 -m "v0.1.1"
-
Publish the new version of the plugin with
poetry
:poetry publish --build