pip/pyproject.toml

193 lines
5.4 KiB
TOML

[project]
dynamic = ["version", "scripts"]
name = "pip"
description = "The PyPA recommended tool for installing Python packages."
readme = "README.rst"
license = {text = "MIT"}
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Topic :: Software Development :: Build Tools",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"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.7"
[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]
# The lower bound is for <https://github.com/pypa/setuptools/issues/3865>.
requires = ["setuptools>=67.6.1", "wheel"]
build-backend = "setuptools.build_meta"
[tool.setuptools]
package-dir = {"" = "src"}
include-package-data = false
[tool.setuptools.dynamic]
version = {attr = "pip.__version__"}
[tool.setuptools.packages.find]
where = ["src"]
exclude = ["contrib", "docs", "tests*", "tasks"]
[tool.setuptools.package-data]
"pip" = ["py.typed"]
"pip._vendor" = ["vendor.txt"]
"pip._vendor.certifi" = ["*.pem"]
"pip._vendor.requests" = ["*.pem"]
"pip._vendor.distlib._backport" = ["sysconfig.cfg"]
"pip._vendor.distlib" = [
"t32.exe",
"t64.exe",
"t64-arm.exe",
"w32.exe",
"w64.exe",
"w64-arm.exe",
]
[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 = "Process", directory = "process", showcontent = true },
{ 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 = "Trivial Changes", directory = "trivial", showcontent = false },
]
[tool.vendoring]
destination = "src/pip/_vendor/"
requirements = "src/pip/_vendor/vendor.txt"
namespace = "pip._vendor"
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 = [
# 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 and lexers
"pygments/styles/[!_]*.py",
'^pygments/lexers/(?!python|__init__|_mapping).*\.py$',
# trim rich's markdown support
"rich/markdown.py",
]
[tool.vendoring.typing-stubs]
six = ["six.__init__", "six.moves.__init__", "six.moves.configparser"]
distro = []
[tool.vendoring.license.directories]
setuptools = "pkg_resources"
[tool.vendoring.license.fallback-urls]
CacheControl = "https://raw.githubusercontent.com/ionrock/cachecontrol/v0.12.6/LICENSE.txt"
distlib = "https://bitbucket.org/pypa/distlib/raw/master/LICENSE.txt"
webencodings = "https://github.com/SimonSapin/python-webencodings/raw/master/LICENSE"
[tool.ruff]
extend-exclude = [
"_vendor",
"./build",
".scratch",
"data",
]
ignore = [
"B019",
"B020",
"B904", # Ruff enables opinionated warnings by default
"B905", # Ruff enables opinionated warnings by default
]
target-version = "py37"
line-length = 88
select = [
"ASYNC",
"B",
"C4",
"C90",
"E",
"F",
"G",
"I",
"ISC",
"PERF",
"PLE",
"PLR0",
"W",
"RUF100",
"UP032",
]
[tool.ruff.isort]
# We need to explicitly make pip "first party" as it's imported by code in
# the docs and tests directories.
known-first-party = ["pip"]
known-third-party = ["pip._vendor"]
[tool.ruff.mccabe]
max-complexity = 33 # default is 10
[tool.ruff.per-file-ignores]
"noxfile.py" = ["G"]
"src/pip/_internal/*" = ["PERF203"]
"tests/*" = ["B011"]
"tests/unit/test_finder.py" = ["C414"]
[tool.ruff.pylint]
max-args = 15 # default is 5
max-branches = 28 # default is 12
max-returns = 13 # default is 6
max-statements = 134 # default is 50