In the Python Packaging User Guide1:
- Tool recommendations: mentions poetry but not hatch
- Packaging Python Projects: uses hatchling as an example (hatch's build backend, equivalent to poetry-core) but mentions poetry in a footnote
- Key projects: mentions that poetry uses its own dependency resolver instead of using pip's (i think we would actually prefer to use the pip dependency resolver?)
- The Packaging Flow: mentions both but uses hatchling in the examples
- Managing Application Dependencies: just mentions both
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
pipx is a much better approach in general.
Moving a project from
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.[^hn-hatch]
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
$ poetry self add poetry-bumpversion
And in your
pyproject.toml, configure as needed:
With this example it will update
to the version in
pyproject.toml, and also keep the version number in
tests/test_version.py up to date.