| [project] | |
| dynamic = ["version"] | |
| name = "pip" | |
| description = "The PyPA recommended tool for installing Python packages." | |
| readme = "README.rst" | |
| license = "MIT" | |
| license-files = [ | |
| "AUTHORS.txt", | |
| "LICENSE.txt", | |
| "src/pip/_vendor/**/*COPYING*", | |
| "src/pip/_vendor/**/*LICENSE*", | |
| ] | |
| classifiers = [ | |
| "Development Status :: 5 - Production/Stable", | |
| "Intended Audience :: Developers", | |
| "Topic :: Software Development :: Build Tools", | |
| "Programming Language :: Python", | |
| "Programming Language :: Python :: 3", | |
| "Programming Language :: Python :: 3 :: Only", | |
| "Programming Language :: Python :: 3.10", | |
| "Programming Language :: Python :: 3.11", | |
| "Programming Language :: Python :: 3.12", | |
| "Programming Language :: Python :: 3.13", | |
| "Programming Language :: Python :: 3.14", | |
| "Programming Language :: Python :: 3.15", | |
| "Programming Language :: Python :: Implementation :: CPython", | |
| "Programming Language :: Python :: Implementation :: PyPy", | |
| ] | |
| authors = [ | |
| {name = "The pip developers", email = "distutils-sig@python.org"}, | |
| ] | |
| # NOTE: requires-python is duplicated in __pip-runner__.py. | |
| # When changing this value, please change the other copy as well. | |
| requires-python = ">=3.10" | |
| [project.scripts] | |
| pip = "pip._internal.cli.main:cli" | |
| pip3 = "pip._internal.cli.main:cli" | |
| [project.urls] | |
| Homepage = "https://pip.pypa.io/" | |
| Documentation = "https://pip.pypa.io" | |
| Source = "https://github.com/pypa/pip" | |
| Changelog = "https://pip.pypa.io/en/stable/news/" | |
| [build-system] | |
| requires = ["flit-core >=3.11,<5"] | |
| build-backend = "flit_core.buildapi" | |
| [dependency-groups] | |
| test = [ | |
| "cryptography", | |
| "flit-core >= 3.11, < 5", | |
| "freezegun", | |
| "installer", | |
| # pytest-subket requires 7.0+ | |
| "pytest >= 7.0", | |
| "pytest-cov", | |
| "pytest-rerunfailures", | |
| "pytest-xdist", | |
| "pytest-subket", | |
| "scripttest", | |
| "setuptools", | |
| "virtualenv >= 20.0.28", | |
| "werkzeug", | |
| "tomli-w", | |
| "proxy.py", | |
| ] | |
| test-common-wheels = [ | |
| "flit-core >= 3.11, < 5", | |
| # We pin setuptools<80 because our test suite currently | |
| # depends on setup.py develop to generate egg-link files. | |
| "setuptools >= 70.1.0, <80", | |
| # As required by pytest-cov. | |
| "coverage >= 4.4", | |
| "pytest-subket >= 0.8.1", | |
| "keyring", | |
| "cmake", | |
| "rich", | |
| ] | |
| typecheck = [ | |
| {include-group = "test"}, | |
| "certifi >= 2026.10.23", | |
| "keyring", # An optional runtime dependency. | |
| "nox", | |
| "packaging", | |
| "httpx", | |
| "rich", | |
| "types-PyYAML", # tools/update-rtd-redirects.py | |
| "types-setuptools", # provides top-level distutils stubs for locations/ | |
| ] | |
| docs = [ | |
| "certifi >= 2026.10.23", | |
| "sphinx ~= 7.0", | |
| # currently incompatible with sphinxcontrib-towncrier | |
| # https://github.com/sphinx-contrib/sphinxcontrib-towncrier/issues/92 | |
| "towncrier < 24", | |
| "furo", | |
| "myst_parser", | |
| "sphinx-copybutton", | |
| "sphinx-inline-tabs", | |
| "sphinxcontrib-towncrier >= 0.2.0a0", | |
| "sphinx-issues", | |
| ] | |
| [tool.flit.sdist] | |
| include = [ | |
| "NEWS.rst", | |
| "SECURITY.md", | |
| "AI_POLICY.md", | |
| "build-project/README.md", | |
| "build-project/build-project.py", | |
| "build-project/pyproject.toml", | |
| "build-project/pylock.toml", | |
| "docs/**/*.css", | |
| "docs/**/*.dot", | |
| "docs/**/*.md", | |
| "docs/**/*.png", | |
| "docs/**/*.py", | |
| "docs/**/*.rst", | |
| ] | |
| exclude = [ | |
| ".devcontainer/devcontainer.json", | |
| "src/pip/_vendor/**/*.pyi", | |
| ] | |
| ###################################################################################### | |
| # towncrier | |
| # | |
| [tool.towncrier] | |
| # For finding the __version__ | |
| package = "pip" | |
| package_dir = "src" | |
| # For writing into the correct file | |
| filename = "NEWS.rst" | |
| # For finding the news fragments | |
| directory = "news/" | |
| # For rendering properly for this project | |
| issue_format = "`#{issue} <https://github.com/pypa/pip/issues/{issue}>`_" | |
| template = "tools/news/template.rst" | |
| # Grouping of entries, within our changelog | |
| type = [ | |
| { name = "Deprecations and Removals", directory = "removal", showcontent = true }, | |
| { name = "Features", directory = "feature", showcontent = true }, | |
| { name = "Bug Fixes", directory = "bugfix", showcontent = true }, | |
| { name = "Vendored Libraries", directory = "vendor", showcontent = true }, | |
| { name = "Improved Documentation", directory = "doc", showcontent = true }, | |
| { name = "Process", directory = "process", showcontent = true }, | |
| { name = "Trivial Changes", directory = "trivial", showcontent = false }, | |
| ] | |
| ###################################################################################### | |
| # vendoring | |
| # | |
| [tool.vendoring] | |
| destination = "src/pip/_vendor/" | |
| requirements = "src/pip/_vendor/vendor.txt" | |
| namespace = "pip._vendor" | |
| sbom-file = "src/pip/_vendor/bom.cdx.json" | |
| protected-files = ["__init__.py", "README.rst", "vendor.txt"] | |
| patches-dir = "tools/vendoring/patches" | |
| [tool.vendoring.transformations] | |
| substitute = [ | |
| # pkg_resource's vendored packages are directly vendored in pip. | |
| { match='pkg_resources\.extern', replace="pip._vendor" }, | |
| { match='from \.extern', replace="from pip._vendor" }, | |
| { match='''\('pygments\.lexers\.''', replace="('pip._vendor.pygments.lexers." }, | |
| ] | |
| drop = [ | |
| # Don't include dist-info directories in the vendored code | |
| "*.dist-info/", | |
| # contains unnecessary scripts | |
| "bin/", | |
| # interpreter and OS specific msgpack libs | |
| "msgpack/*.so", | |
| # unneeded parts of setuptools | |
| "easy_install.py", | |
| "setuptools", | |
| "pkg_resources/_vendor/", | |
| "_distutils_hack", | |
| "distutils-precedence.pth", | |
| "pkg_resources/extern/", | |
| # trim vendored pygments styles, lexers, formatters, and CLI | |
| "pygments/styles/[!_]*.py", | |
| '^pygments/lexers/(?!python|__init__|_mapping).*\.py$', | |
| '^pygments/formatters/(?!__init__|_mapping).*\.py$', | |
| '^pygments/cmdline\.py$', | |
| # trim rich's markdown support | |
| "rich/markdown.py", | |
| # trim parts of distlib that aren't related to scripts | |
| '^distlib/(?!__init__|compat|resources|scripts|util).*\.py$', | |
| ] | |
| [tool.vendoring.typing-stubs] | |
| distro = [] | |
| [tool.vendoring.license.directories] | |
| setuptools = "pkg_resources" | |
| [tool.vendoring.license.fallback-urls] | |
| distlib = "https://bitbucket.org/pypa/distlib/raw/master/LICENSE.txt" | |
| ###################################################################################### | |
| # ruff | |
| # | |
| [tool.ruff] | |
| # Pinned to delay pyupgrade changes (https://github.com/pypa/pip/issues/13236) | |
| target-version = "py310" # Pin Ruff to Python 3.10 | |
| src = ["src"] | |
| line-length = 88 | |
| extend-exclude = [ | |
| "_vendor", | |
| "./build", | |
| ".scratch", | |
| "data", | |
| ] | |
| [tool.ruff.lint] | |
| ignore = [ | |
| "B020", | |
| "B904", # Ruff enables opinionated warnings by default | |
| "B905", # Ruff enables opinionated warnings by default | |
| "C420", # unnecessary-dict-comprehension-for-iterable (worsens readability) | |
| "ISC004" # implicit-string-concatenation-in-collection-literal | |
| ] | |
| select = [ | |
| "ASYNC", | |
| "B", | |
| "C4", | |
| "C90", | |
| "E", | |
| "F", | |
| "FA", | |
| "G", | |
| "I", | |
| "ISC", | |
| "PIE810", | |
| "PLE", | |
| "PLR0", | |
| "RUF100", | |
| "UP", | |
| "W", | |
| ] | |
| [tool.ruff.lint.isort] | |
| section-order = [ | |
| "future", | |
| "standard-library", | |
| "third-party", | |
| "vendored", | |
| "first-party", | |
| "tests", | |
| "local-folder", | |
| ] | |
| [tool.ruff.lint.isort.sections] | |
| "vendored" = ["pip._vendor"] | |
| "tests" = ["tests"] | |
| [tool.ruff.lint.mccabe] | |
| max-complexity = 33 # default is 10 | |
| [tool.ruff.lint.per-file-ignores] | |
| "noxfile.py" = ["G"] | |
| "src/pip/_internal/*" = ["PERF203"] | |
| "tests/*" = ["B011"] | |
| "tests/unit/test_finder.py" = ["C414"] | |
| "src/pip/__pip-runner__.py" = ["UP"] # Must be compatible with Python 2.7 | |
| [tool.ruff.lint.pylint] | |
| max-args = 16 # default is 5 | |
| max-branches = 28 # default is 12 | |
| max-returns = 15 # default is 6 | |
| max-statements = 134 # default is 50 | |
| [tool.ruff.per-file-target-version] | |
| # `__pip-runner__.py` should be Python 2.7 compatible but the | |
| # earliest version of Python ruff will check is 3.7 | |
| "src/pip/__pip-runner__.py" = "py37" | |
| ###################################################################################### | |
| # mypy | |
| # | |
| [tool.mypy] | |
| mypy_path = "$MYPY_CONFIG_FILE_DIR/src" | |
| strict = true | |
| no_implicit_reexport = false | |
| disallow_subclassing_any = false | |
| disallow_untyped_calls = false | |
| warn_return_any = false | |
| ignore_missing_imports = true | |
| [[tool.mypy.overrides]] | |
| module = "pip._internal.utils._jaraco_text" | |
| ignore_errors = true | |
| [[tool.mypy.overrides]] | |
| module = "pip._vendor.*" | |
| ignore_errors = true | |
| # These vendored libraries use runtime magic to populate things and don't sit | |
| # well with static typing out of the box. Eventually we should provide correct | |
| # typing information for their public interface and remove these configs. | |
| [[tool.mypy.overrides]] | |
| module = "pip._vendor.pkg_resources" | |
| follow_imports = "skip" | |
| ###################################################################################### | |
| # pytest | |
| # | |
| [tool.pytest.ini_options] | |
| addopts = [ | |
| "-r=aR", | |
| "--color=yes", | |
| "--ignore=src/pip/_vendor", | |
| "--ignore=tests/tests_cache", | |
| "--disable-socket", | |
| "--allow-unix-socket", | |
| "--allow-hosts=localhost", | |
| ] | |
| xfail_strict = true | |
| markers = [ | |
| "network: tests that need network", | |
| "incompatible_with_sysconfig", | |
| "incompatible_with_venv", | |
| "no_auto_tempdir_manager", | |
| "unit: unit tests", | |
| "integration: integration tests", | |
| "bzr: VCS: Bazaar", | |
| "svn: VCS: Subversion", | |
| "mercurial: VCS: Mercurial", | |
| "git: VCS: git", | |
| "search: tests for 'pip search'", | |
| ] | |
| filterwarnings = [ | |
| 'error::pip._internal.utils.deprecation.PipDeprecationWarning:', | |
| ] | |
| ###################################################################################### | |
| # coverage | |
| # | |
| [tool.coverage.run] | |
| branch = true | |
| # Do not gather coverage for vendored libraries. | |
| omit = ["*/_vendor/*"] | |
| # Centralized absolute file prefix for coverage files. | |
| data_file = "${COVERAGE_OUTPUT_DIR}/.coverage" | |
| # By default, each covered process will try to truncate and then write to | |
| # `data_file`, but with `parallel`, they will write to separate files suffixed | |
| # with hostname, pid, and a timestamp. | |
| parallel = true | |
| # If not set, then at the termination of each worker (when using pytest-xdist), | |
| # the following is traced: "Coverage.py warning: Module pip was previously | |
| # imported, but not measured (module-not-measured)" | |
| disable_warnings = ["module-not-measured"] | |
| [tool.coverage.paths] | |
| # We intentionally use "source0" here because pytest-cov unconditionally sets | |
| # "source" after loading the config. | |
| source0 = [ | |
| # The primary source code path which other paths will be combined into. | |
| "src/pip/", | |
| # Unit test source directory e.g. | |
| # `.tox/coverage-py3/lib/pythonX.Y/site-packages/pip/...` | |
| "*/site-packages/pip/", | |
| # Functional test virtual environment directories, which look like | |
| # `tmpdir/pip0/pip/src/pip/...` | |
| "*/pip/src/pip/", | |
| ] | |
| [tool.coverage.report] | |
| exclude_also = [ | |
| # This excludes typing-specific code, which will be validated by mypy anyway. | |
| "if TYPE_CHECKING", | |
| ] | |
| [tool.check-sdist] | |
| git-only = [ | |
| "tests/**", | |
| "tools/**", | |
| "news/.gitignore", | |
| ".devcontainer/**", | |
| ".gitattributes", | |
| ".gitignore", | |
| ".git-blame-ignore-revs", | |
| ".mailmap", | |
| ".readthedocs-custom-redirects.yml" | |
| ] |