Skip to content

Commit 003c7ac

Browse files
committed
Migrate project metadata to pyproject.toml
Since setuptools defaults `include_package_data` to `True` if it sees a `project` table, explicitly set it to `False` to prevent unnecessary files from being added. Due to differences between the semantics of `pyproject.toml` and `setup.py` settings, there are some minor changes in the resulting metadata: diff -Nur dist-old/whl/pip-23.1.dev0.dist-info/METADATA dist/whl/pip-23.1.dev0.dist-info/METADATA --- dist-old/whl/pip-23.1.dev0.dist-info/METADATA 2023-03-28 18:46:48.000000000 +0300 +++ dist/whl/pip-23.1.dev0.dist-info/METADATA 2023-03-28 18:43:28.000000000 +0300 @@ -2,10 +2,9 @@ Name: pip Version: 23.1.dev0 Summary: The PyPA recommended tool for installing Python packages. -Home-page: https://pip.pypa.io/ -Author: The pip developers -Author-email: [email protected] +Author-email: The pip developers <[email protected]> License: MIT +Project-URL: Homepage, https://pip.pypa.io/ Project-URL: Documentation, https://pip.pypa.io Project-URL: Source, https://github.com/pypa/pip Project-URL: Changelog, https://pip.pypa.io/en/stable/news/ @@ -24,6 +23,7 @@ Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy Requires-Python: >=3.7 +Description-Content-Type: text/x-rst License-File: LICENSE.txt License-File: AUTHORS.txt black uses the `project.requires-python` setting to infer the target Python version. Reformat one file in which this actually changes the formatting.
1 parent dfaac0a commit 003c7ac

File tree

4 files changed

+43
-36
lines changed

4 files changed

+43
-36
lines changed

news/11909.process.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Most project metadata is now defined statically via pip's ``pyproject.toml`` file.

pyproject.toml

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,44 @@
1+
[project]
2+
dynamic = ["version", "scripts"]
3+
4+
name = "pip"
5+
description = "The PyPA recommended tool for installing Python packages."
6+
readme = "README.rst"
7+
license = {text = "MIT"}
8+
classifiers = [
9+
"Development Status :: 5 - Production/Stable",
10+
"Intended Audience :: Developers",
11+
"License :: OSI Approved :: MIT License",
12+
"Topic :: Software Development :: Build Tools",
13+
"Programming Language :: Python",
14+
"Programming Language :: Python :: 3",
15+
"Programming Language :: Python :: 3 :: Only",
16+
"Programming Language :: Python :: 3.7",
17+
"Programming Language :: Python :: 3.8",
18+
"Programming Language :: Python :: 3.9",
19+
"Programming Language :: Python :: 3.10",
20+
"Programming Language :: Python :: 3.11",
21+
"Programming Language :: Python :: 3.12",
22+
"Programming Language :: Python :: Implementation :: CPython",
23+
"Programming Language :: Python :: Implementation :: PyPy",
24+
]
25+
authors = [
26+
{name = "The pip developers", email = "[email protected]"},
27+
]
28+
29+
# NOTE: requires-python is duplicated in __pip-runner__.py.
30+
# When changing this value, please change the other copy as well.
31+
requires-python = ">=3.7"
32+
33+
[project.urls]
34+
Homepage = "https://pip.pypa.io/"
35+
Documentation = "https://pip.pypa.io"
36+
Source = "https://github.com/pypa/pip"
37+
Changelog = "https://pip.pypa.io/en/stable/news/"
38+
139
[build-system]
2-
requires = ["setuptools", "wheel"]
40+
# The lower bound is for <https://github.com/pypa/setuptools/issues/3865>.
41+
requires = ["setuptools>=67.6.1", "wheel"]
342
build-backend = "setuptools.build_meta"
443

544
[tool.towncrier]

setup.py

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -21,44 +21,14 @@ def get_version(rel_path: str) -> str:
2121
raise RuntimeError("Unable to find version string.")
2222

2323

24-
long_description = read("README.rst")
25-
2624
setup(
27-
name="pip",
2825
version=get_version("src/pip/__init__.py"),
29-
description="The PyPA recommended tool for installing Python packages.",
30-
long_description=long_description,
31-
license="MIT",
32-
classifiers=[
33-
"Development Status :: 5 - Production/Stable",
34-
"Intended Audience :: Developers",
35-
"License :: OSI Approved :: MIT License",
36-
"Topic :: Software Development :: Build Tools",
37-
"Programming Language :: Python",
38-
"Programming Language :: Python :: 3",
39-
"Programming Language :: Python :: 3 :: Only",
40-
"Programming Language :: Python :: 3.7",
41-
"Programming Language :: Python :: 3.8",
42-
"Programming Language :: Python :: 3.9",
43-
"Programming Language :: Python :: 3.10",
44-
"Programming Language :: Python :: 3.11",
45-
"Programming Language :: Python :: 3.12",
46-
"Programming Language :: Python :: Implementation :: CPython",
47-
"Programming Language :: Python :: Implementation :: PyPy",
48-
],
49-
url="https://pip.pypa.io/",
50-
project_urls={
51-
"Documentation": "https://pip.pypa.io",
52-
"Source": "https://github.com/pypa/pip",
53-
"Changelog": "https://pip.pypa.io/en/stable/news/",
54-
},
55-
author="The pip developers",
56-
author_email="[email protected]",
5726
package_dir={"": "src"},
5827
packages=find_packages(
5928
where="src",
6029
exclude=["contrib", "docs", "tests*", "tasks"],
6130
),
31+
include_package_data=False,
6232
package_data={
6333
"pip": ["py.typed"],
6434
"pip._vendor": ["vendor.txt"],
@@ -82,7 +52,4 @@ def get_version(rel_path: str) -> str:
8252
],
8353
},
8454
zip_safe=False,
85-
# NOTE: python_requires is duplicated in __pip-runner__.py.
86-
# When changing this value, please change the other copy as well.
87-
python_requires=">=3.7",
8855
)

tests/unit/test_network_auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ def __call__(
406406
stdin: Optional[Any] = None,
407407
stdout: Optional[Any] = None,
408408
input: Optional[bytes] = None,
409-
check: Optional[bool] = None
409+
check: Optional[bool] = None,
410410
) -> Any:
411411
if cmd[1] == "get":
412412
assert stdin == -3 # subprocess.DEVNULL

0 commit comments

Comments
 (0)