How to update PyPI package version via Poetry

created:

updated:

tags: python poetry pypi

Today, I made some small refactoring change to canada-holiday PyPI package and I realized I forgot how to bump PyPI package version.

After googling, I found out how to do it, and I’d like to record it here. The reference has a great explanation, and I followed it when I first created my PyPI account and published it.

Build Project

poetry build

This allows us to package our project. It outputs a source file in .tar.gz format and the compiled package, wheel in .whl format.

Publish Python Package to PyPI

poetry publish

This command will publish the above compiled package to PyPI. Depending on the configuration, we may need to provide credentials with flags here:

poetry publish --username <username> --password <password>

Reference