Skip to content

Commit 9abe081

Browse files
committed
Use flit to build pip distributions
1 parent bef3535 commit 9abe081

File tree

6 files changed

+44
-71
lines changed

6 files changed

+44
-71
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
- run: pip install nox
8383
- run: nox -s prepare-release -- 99.9
8484
- run: nox -s build-release -- 99.9
85-
- run: pipx run check-manifest
85+
- run: pipx run check-sdist
8686

8787
vendoring:
8888
name: vendoring

MANIFEST.in

Lines changed: 0 additions & 34 deletions
This file was deleted.

build-project/build-requirements.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
build
2-
setuptools
2+
flit-core

build-project/build-requirements.txt

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,15 @@ build==1.2.2.post1 \
88
--hash=sha256:1d61c0887fa860c01971625baae8bdd338e517b836a2f70dd1f7aa3a6b2fc5b5 \
99
--hash=sha256:b36993e92ca9375a219c99e606a122ff365a760a2d4bba0caa09bd5278b608b7
1010
# via -r build-requirements.in
11-
packaging==24.2 \
12-
--hash=sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759 \
13-
--hash=sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f
11+
flit-core==3.12.0 \
12+
--hash=sha256:18f63100d6f94385c6ed57a72073443e1a71a4acb4339491615d0f16d6ff01b2 \
13+
--hash=sha256:e7a0304069ea895172e3c7bb703292e992c5d1555dd1233ab7b5621b5b69e62c
14+
# via -r build-requirements.in
15+
packaging==25.0 \
16+
--hash=sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484 \
17+
--hash=sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f
1418
# via build
1519
pyproject-hooks==1.2.0 \
1620
--hash=sha256:1e859bd5c40fae9448642dd871adf459e5e2084186e8d2c2a79a824c970da1f8 \
1721
--hash=sha256:9e5c6bfa8dcc30091c74b0cf803c81fdd29d94f01992a7707bc97babb1141913
1822
# via build
19-
20-
# The following packages are considered to be unsafe in a requirements file:
21-
setuptools==80.9.0 \
22-
--hash=sha256:062d34222ad13e0cc312a4c02d73f059e86a4acbfbdea8f8f76b28c99f306922 \
23-
--hash=sha256:f36b47402ecde768dbfafc46e8e4207b4360c654f1f3bb84475f0a28628fb19c
24-
# via -r build-requirements.in

docs/html/development/architecture/anatomy.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ The ``README``, license, ``pyproject.toml``, and so on are in the top level.
1818

1919
* ``AUTHORS.txt``
2020
* ``LICENSE.txt``
21-
* ``MANIFEST.in``
2221
* ``NEWS.rst``
2322
* ``pyproject.toml``
2423
* ``README.rst``

pyproject.toml

Lines changed: 35 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
[project]
22
dynamic = ["version"]
3-
43
name = "pip"
54
description = "The PyPA recommended tool for installing Python packages."
65
readme = "README.rst"
@@ -46,12 +45,13 @@ Source = "https://github.com/pypa/pip"
4645
Changelog = "https://pip.pypa.io/en/stable/news/"
4746

4847
[build-system]
49-
requires = ["setuptools>=77"]
50-
build-backend = "setuptools.build_meta"
48+
requires = ["flit-core >=3.11,<4"]
49+
build-backend = "flit_core.buildapi"
5150

5251
[dependency-groups]
5352
test = [
5453
"cryptography",
54+
"flit-core >= 3.11, < 4",
5555
"freezegun",
5656
"installer",
5757
# pytest-subket requires 7.0+
@@ -73,37 +73,35 @@ test = [
7373
]
7474

7575
test-common-wheels = [
76+
"flit-core >= 3.11, < 4",
7677
# We pin setuptools<80 because our test suite currently
7778
# depends on setup.py develop to generate egg-link files.
7879
"setuptools >= 40.8.0, != 60.6.0, <80",
7980
"wheel",
81+
"flit-core",
8082
# As required by pytest-cov.
8183
"coverage >= 4.4",
8284
"pytest-subket >= 0.8.1",
8385
]
8486

85-
[tool.setuptools]
86-
package-dir = {"" = "src"}
87-
include-package-data = false
88-
89-
[tool.setuptools.dynamic]
90-
version = {attr = "pip.__version__"}
91-
92-
[tool.setuptools.packages.find]
93-
where = ["src"]
94-
exclude = ["contrib", "docs", "tests*", "tasks"]
95-
96-
[tool.setuptools.package-data]
97-
"pip" = ["py.typed"]
98-
"pip._vendor" = ["vendor.txt"]
99-
"pip._vendor.certifi" = ["*.pem"]
100-
"pip._vendor.distlib" = [
101-
"t32.exe",
102-
"t64.exe",
103-
"t64-arm.exe",
104-
"w32.exe",
105-
"w64.exe",
106-
"w64-arm.exe",
87+
[tool.flit.sdist]
88+
include = [
89+
"NEWS.rst",
90+
"SECURITY.md",
91+
"build-project/.python-version",
92+
"build-project/build-project.py",
93+
"build-project/build-requirements.in",
94+
"build-project/build-requirements.txt",
95+
"docs/requirements.txt",
96+
"docs/**/*.css",
97+
"docs/**/*.dot",
98+
"docs/**/*.md",
99+
"docs/**/*.png",
100+
"docs/**/*.py",
101+
"docs/**/*.rst",
102+
]
103+
exclude = [
104+
"src/pip/_vendor/**/*.pyi",
107105
]
108106

109107
######################################################################################
@@ -362,3 +360,15 @@ exclude_also = [
362360
# This excludes typing-specific code, which will be validated by mypy anyway.
363361
"if TYPE_CHECKING",
364362
]
363+
364+
[tool.check-sdist]
365+
git-only = [
366+
"tests/**",
367+
"tools/**",
368+
"news/.gitignore",
369+
".gitattributes",
370+
".gitignore",
371+
".git-blame-ignore-revs",
372+
".mailmap",
373+
".readthedocs-custom-redirects.yml"
374+
]

0 commit comments

Comments
 (0)