# Extension points — pypa/hatch

> Canonical page: https://codevetter.com/unpack/hatch/extension-points

# Extension points — pypa/hatch

Scanned commit 7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0 (2026-09-20). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

The principal extension mechanism is pluggy registration of named classes. Hatch adds environment, collector, publisher, template, and locker registries to Hatchling's build and version registries. Builders expose artifact-version functions and ordered hooks, while environments and lockers expose lifecycle contracts. CLI command lists and dependency-source parser tables provide additional explicit dispatch points.
- Plugins declare registration hooks with hatchling.plugin.hookimpl, return one or more classes carrying PLUGIN_NAME, and advertise their hook module through project.entry-points.hatch. — [docs/plugins/about.md#L9-L32](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/docs/plugins/about.md#L9-L32) [docs/plugins/about.md#L46-L55](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/docs/plugins/about.md#L46-L55) [backend/src/hatchling/plugin/manager.py#L68-L101](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/backend/src/hatchling/plugin/manager.py#L68-L101)
- Hatch's PluginManager extends Hatchling's manager and registers environment, environment_collector, publisher, template, and locker hook providers; backend registries cover builders, build hooks, metadata hooks, version sources, and schemes. — [src/hatch/plugin/manager.py#L1-L35](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/src/hatch/plugin/manager.py#L1-L35) [backend/src/hatchling/plugin/manager.py#L36-L59](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/backend/src/hatchling/plugin/manager.py#L36-L59)
- New environment types enter through project.config type selection and plugin_manager.environment.get; their contract includes command execution, dependency hashing, filesystem contexts, compatibility checks, and typed override options. — [src/hatch/project/core.py#L141-L180](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/src/hatch/project/core.py#L141-L180) [src/hatch/env/plugin/interface.py#L857-L869](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/src/hatch/env/plugin/interface.py#L857-L869) [src/hatch/env/plugin/interface.py#L937-L972](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/src/hatch/env/plugin/interface.py#L937-L972) [src/hatch/env/plugin/interface.py#L1054-L1098](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/src/hatch/env/plugin/interface.py#L1054-L1098)
- LockerInterface defines supports/generate/in_sync/apply_lock plus optional installation conformance checks; resolution prefers environment locker, then project locker, then uv/pip based on the environment, and built-in hooks register both implementations. — [src/hatch/env/lockers/interface.py#L18-L76](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/src/hatch/env/lockers/interface.py#L18-L76) [src/hatch/env/lock.py#L119-L134](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/src/hatch/env/lock.py#L119-L134) [src/hatch/env/lockers/hooks.py#L1-L8](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/src/hatch/env/lockers/hooks.py#L1-L8)
- BuilderInterface.get_version_api maps version names to artifact-producing functions, get_config_class supplies target configuration, and hooks receive shared build_data through initialize/finalize; WheelBuilder maps standard and editable variants. — [backend/src/hatchling/builders/plugin/interface.py#L147-L176](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/backend/src/hatchling/builders/plugin/interface.py#L147-L176) [backend/src/hatchling/builders/plugin/interface.py#L405-L445](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/backend/src/hatchling/builders/plugin/interface.py#L405-L445) [backend/src/hatchling/builders/wheel.py#L495-L506](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/backend/src/hatchling/builders/wheel.py#L495-L506)
- Metadata hooks update core_raw_metadata and contribute known classifiers; dynamically introduced fields must appear in project.dynamic, while custom script loaders select a get_<plugin_id> factory or a unique interface subclass. — [backend/src/hatchling/metadata/core.py#L195-L226](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/backend/src/hatchling/metadata/core.py#L195-L226) [backend/src/hatchling/plugin/utils.py#L13-L48](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/backend/src/hatchling/plugin/utils.py#L13-L48)
- Publisher selection instantiates a registered class with application, root, cache, project configuration, and user configuration; templates are ordered by PRIORITY and expose initialize_config/get_files/finalize_files stages. — [src/hatch/cli/publish/__init__.py#L101-L115](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/src/hatch/cli/publish/__init__.py#L101-L115) [src/hatch/cli/new/__init__.py#L102-L137](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/src/hatch/cli/new/__init__.py#L102-L137)
- CLI additions attach to explicit Click add_command lists or argparse registration calls; dependency-source parsing uses _SOURCE_PARSERS after enforcing exactly one recognized source-type key. — [src/hatch/cli/__init__.py#L221-L238](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/src/hatch/cli/__init__.py#L221-L238) [backend/src/hatchling/cli/__init__.py#L9-L18](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/backend/src/hatchling/cli/__init__.py#L9-L18) [src/hatch/project/sources.py#L160-L194](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/src/hatch/project/sources.py#L160-L194)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
