Builds and packaging tools

In the Python Packaging User Guide1:


Hatch is maintained by PyPA (Python Packing Authority), same as other standard tools like pip, setuptools, virtualenv, and twine.


You are probably going to want to install Hatch from PyPI rather than your distros package manager, since Hatch is under active development and new versions are released somewhat freqnely.

$ python3 -m pip install --user pipx
$ pipx install hatch

You may of course also install it directly with pip install, though using pipx is a much better approach in general.

Switching project to hatch

Moving a project from poetry to hatch is easy, but not trivial.


Poetry is mainly used for managing an application and its dependencies whereas Hatch is more agnostic to the project type and offers plugin-based functionality for the entire workflow (versioning, tox-like environments, publishing) so you can easily build things other than wheel/sdist, test in a Docker container, etc.2


Use poetry-bumpversion with Poetry to make managing the project's version easier. Its a plugin for Poetry itself, and thus not tied to the project (which would have been nice) or it's pyproject.toml file.

$ poetry self add poetry-bumpversion

And in your pyproject.toml, configure as needed:


With this example it will update __version__ in ${module_name}/ to the version in pyproject.toml, and also keep the version number in tests/ up to date.