CodeVetter · Repo Unpack · Extension points
pypa/pip
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.
- Sub-actions attach through handler_map() in configuration, cache, and index commands; each run() validates the action and routes remaining arguments to a callable.
- Command options attach through add_options() and cmdoptions helpers/groups; ConfigOptionParser gives them shared configuration loading, section precedence, and default-value validation.
- RequirementCommand.make_resolver() selects resolvelib or legacy implementations; PipProvider.find_matches() delegates candidate construction to Factory with constraints, incompatibilities, and installed-candidate preference.
- 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.
- 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.
- Build integration has two seams: BuildEnvironmentInstaller defines dependency installation, while ConfiguredBuildBackendHookCaller forwards wheel, sdist, editable, and dependency hooks using the requirement's config_settings.
- 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.