hatch
modern Python project manager
TLDR
Create new project
$ hatch new [project-name]
Build package$ hatch build
Run tests$ hatch run test
Enter environment$ hatch shell
Publish to PyPI$ hatch publish
Show project info$ hatch status
SYNOPSIS
hatch [options] command [args]
DESCRIPTION
Hatch is a modern Python project manager. It handles project creation, building, publishing, environment management, and testing in a unified tool.
Hatch uses pyproject.toml for configuration and supports PEP standards. It provides reproducible environments and multi-environment testing.
PARAMETERS
new name
Create new project.build
Build distributions.publish
Publish to package index.run cmd
Run command in environment.shell
Enter project environment.env subcommand
Manage environments.test
Run tests across environments.fmt
Format code.version
Show/bump version.clean
Remove build artifacts.
PYPROJECT.TOML
$ [build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "myproject"
version = "0.1.0"
[tool.hatch.envs.default]
dependencies = ["pytest"]
[tool.hatch.envs.default.scripts]
test = "pytest {args}"
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "myproject"
version = "0.1.0"
[tool.hatch.envs.default]
dependencies = ["pytest"]
[tool.hatch.envs.default.scripts]
test = "pytest {args}"
CAVEATS
Relatively new; ecosystem still growing. Different workflow from pip/setuptools. Environment management differs from virtualenv. Some plugins may be needed.
HISTORY
Hatch was created by Ofek Lev as a modern replacement for traditional Python packaging tools. It follows current PEP standards and aims to simplify the Python project lifecycle.
