Hatch Python project manager
Light · Postcard
102 × 152 mm · PDF
Dark · Postcard
102 × 152 mm · PDF
Ink saver · Postcard
102 × 152 mm · PDF
Light · A4 landscape
297 × 210 mm · PDF
Dark · A4 landscape
297 × 210 mm · PDF
Ink saver · A4 landscape
297 × 210 mm · PDF
Light · A3 landscape
420 × 297 mm · PDF
Dark · A3 landscape
420 × 297 mm · PDF
Ink saver · A3 landscape
420 × 297 mm · PDF
Start here
hatch new <name>
hatch shellhatch run <cmd>
hatch run test:<cmd>
hatch testhatch fmthatch version patch
hatch buildConcepts
- pyproject.toml envs, scripts, version
- Environment isolated virtualenv
- dist/ sdist and wheel
- Index PyPI
Projects
hatch new <name>
hatch new --cli <name>
hatch new --init
hatch project metadata
Environments
hatch shellhatch shell <env>
hatch env create
hatch env create <env>
hatch env showhatch env find <env>
hatch env remove <env>
hatch env pruneRunning commands
hatch run <cmd>
hatch run <env>:<cmd>
hatch run <script>
hatch -e <env> run <cmd>
hatch run +py=3.12 <env>:<cmd>
hatch run -py=3.9 <env>:<cmd>
Testing and quality
hatch testhatch test -chatch test -ahatch test -py 3.12
hatch test -phatch test <path>::<test>
hatch fmthatch fmt --check
hatch fmt -lhatch fmt -fhatch fmt --sync
hatch checkVersioning
hatch versionhatch version <x.y.z>
hatch version patch
hatch version minor
hatch version major
Build and publish
hatch buildhatch build -t wheel
hatch build -chatch cleanhatch publishhatch publish -r test
hatch publish -u __token__ -a <token>
Dependencies and Python
hatch dep show requirements
hatch dep show table
hatch lockhatch python show
hatch python install <version>
Config in pyproject.toml
[tool.hatch.version]
[tool.hatch.envs.<name>]
[[tool.hatch.envs.<name>.matrix]]
hatch config show
hatch self update
Recipes
# pyproject.toml[tool.hatch.envs.test]dependencies = ["pytest"][tool.hatch.envs.test.scripts]run = "pytest {args}"[[tool.hatch.envs.test.matrix]]python = ["3.11", "3.12"]
# pyproject.toml[project]dynamic = ["version"][tool.hatch.version]path = "src/demo/__about__.py"
hatch version minorhatch build -chatch publish -r testhatch publish



