CodeVetter · Repo Unpack · System map
pypa/hatch
The repository ships a project-management frontend and an independently packaged build backend. Hatch coordinates configuration, environments, subprocesses, and publishing, while Hatchling owns distribution construction and packaging metadata. Runtime state resides in configured filesystem locations, and integrations include installers, package indices, keyring, and downloaded Python distributions. Release workflows produce Python packages, standalone executables, installers, and documentation.
- The Hatch distribution requires Python >=3.10 and exposes hatch = hatch.cli:main; src/hatch/__main__.py delegates module execution to that same main function.
- Hatchling is a separate distribution bootstrapped through hatchling.ouroboros with backend-path=['src']; it exposes hatchling.cli:hatchling and standard build/editable backend functions.
- The frontend uses Click command registration and Application(Terminal); the backend CLI uses argparse and dispatches build, dep, metadata, and version handlers.
- Project lazily owns PluginManager, ProjectConfig, ProjectMetadata, a selected build environment, and BuildFrontend; get_environment constructs the plugin selected by configuration type.
- Global configuration defaults to platformdirs' Hatch config.toml; environment hashes use JSON beneath data_dir/env/.metadata, and virtual environments support configured external paths.
- VirtualEnvironment selects VirtualEnv or UVVirtualEnv, PackageIndex uses HTTPX2, AuthenticationCredentials uses keyring, and PythonManager downloads and installs interpreter archives.
- Repository workflows use hatch test, hatch fmt --check, and hatch run types:check; hatch.toml defines backend builds, coverage reporting, and strict documentation build/link checks.
- Hatch release automation builds wheels/sdists, PyApp binaries, Windows installers, and signed/notarized macOS packaging; Hatchling releases publish backend/dist, while documentation workflows publish GitHub Pages.