# Extension points — pypa/pip

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

# Extension points — pypa/pip

Scanned commit a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6 (2026-09-23). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

Most extension points are internal seams for maintainers rather than public plugin contracts. Commands, action maps, option groups, resolver factories, metadata backends, and VCS registries centralize particular choices. Standards-based build hooks provide an external integration boundary. New behavior should enter through the relevant seam while preserving shared parsing, preparation, and installation invariants.
- New built-in commands attach through commands_dict and a Command subclass; the registry controls help ordering, and create_command() supplies name, summary, and shared constructor arguments through lazy import. — [src/pip/_internal/commands/__init__.py#L13-L27](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/commands/__init__.py#L13-L27) [src/pip/_internal/commands/__init__.py#L116-L125](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/commands/__init__.py#L116-L125)
- Sub-actions attach through handler_map() in configuration, cache, and index commands; each run() validates the action and routes remaining arguments to a callable. — [src/pip/_internal/commands/configuration.py#L99-L145](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/commands/configuration.py#L99-L145) [src/pip/_internal/commands/cache.py#L52-L85](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/commands/cache.py#L52-L85) [src/pip/_internal/commands/index.py#L65-L87](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/commands/index.py#L65-L87)
- Command options attach through add_options() and cmdoptions helpers/groups; ConfigOptionParser gives them shared configuration loading, section precedence, and default-value validation. — [src/pip/_internal/commands/install.py#L163-L171](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/commands/install.py#L163-L171) [src/pip/_internal/commands/lock.py#L82-L94](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/commands/lock.py#L82-L94) [src/pip/_internal/cli/parser.py#L202-L224](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/cli/parser.py#L202-L224) [src/pip/_internal/cli/parser.py#L321-L341](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/cli/parser.py#L321-L341)
- RequirementCommand.make_resolver() selects resolvelib or legacy implementations; PipProvider.find_matches() delegates candidate construction to Factory with constraints, incompatibilities, and installed-candidate preference. — [src/pip/_internal/cli/req_command.py#L251-L307](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/cli/req_command.py#L251-L307) [src/pip/_internal/resolution/resolvelib/provider.py#L259-L299](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/resolution/resolvelib/provider.py#L259-L299)
- PackageFinder discovery uses a LinkCollector callback plus link evaluation; its locked-link branch provides a dedicated path for exact artifact selection without querying ordinary indexes or find-links sources. — [src/pip/_internal/index/package_finder.py#L892-L917](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/index/package_finder.py#L892-L917) [src/pip/_internal/cli/req_command.py#L370-L381](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/cli/req_command.py#L370-L381)
- Metadata implementations conform to Backend's Distribution and Environment types; select_backend() caches the choice, with Python-version rules and _PIP_USE_IMPORTLIB_METADATA overrides below Python 3.14. — [src/pip/_internal/metadata/__init__.py#L30-L60](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/metadata/__init__.py#L30-L60) [src/pip/_internal/metadata/__init__.py#L88-L105](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/metadata/__init__.py#L88-L105)
- Build integration has two seams: BuildEnvironmentInstaller defines dependency installation, while ConfiguredBuildBackendHookCaller forwards wheel, sdist, editable, and dependency hooks using the requirement's config_settings. — [src/pip/_internal/build_env/base.py#L36-L59](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/build_env/base.py#L36-L59) [src/pip/_internal/utils/misc.py#L711-L724](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/utils/misc.py#L711-L724) [src/pip/_internal/utils/misc.py#L744-L789](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/utils/misc.py#L744-L789)
- VcsSupport.register() instantiates backend classes by name, exposes their schemes and directory markers, and supports unregistering; VersionControl.get_repository_root() is intended for backend-specific detection overrides. — [src/pip/_internal/vcs/versioncontrol.py#L180-L205](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/vcs/versioncontrol.py#L180-L205) [src/pip/_internal/vcs/versioncontrol.py#L681-L694](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/vcs/versioncontrol.py#L681-L694)

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)
