-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Use flit-core to build pip distributions
#13473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
9abe081
95f685d
41352df
a7807be
61faf90
b1a16f8
d652eb9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| build | ||
| setuptools | ||
| flit-core |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Building pip itself from source now uses flit-core instead of setuptools. | ||
| This does not affect how pip installs or builds packages you use. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,5 @@ | ||
| [project] | ||
| dynamic = ["version"] | ||
|
|
||
| name = "pip" | ||
| description = "The PyPA recommended tool for installing Python packages." | ||
| readme = "README.rst" | ||
|
|
@@ -46,12 +45,13 @@ Source = "https://github.com/pypa/pip" | |
| Changelog = "https://pip.pypa.io/en/stable/news/" | ||
|
|
||
| [build-system] | ||
| requires = ["setuptools>=77"] | ||
| build-backend = "setuptools.build_meta" | ||
| requires = ["flit-core >=3.11,<4"] | ||
| build-backend = "flit_core.buildapi" | ||
|
|
||
| [dependency-groups] | ||
| test = [ | ||
| "cryptography", | ||
| "flit-core >= 3.11, < 4", | ||
| "freezegun", | ||
| "installer", | ||
| # pytest-subket requires 7.0+ | ||
|
|
@@ -73,37 +73,35 @@ test = [ | |
| ] | ||
|
|
||
| test-common-wheels = [ | ||
| "flit-core >= 3.11, < 4", | ||
| # We pin setuptools<80 because our test suite currently | ||
| # depends on setup.py develop to generate egg-link files. | ||
| "setuptools >= 40.8.0, != 60.6.0, <80", | ||
| "wheel", | ||
| "flit-core", | ||
| # As required by pytest-cov. | ||
| "coverage >= 4.4", | ||
| "pytest-subket >= 0.8.1", | ||
| ] | ||
|
|
||
| [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.distlib" = [ | ||
| "t32.exe", | ||
| "t64.exe", | ||
| "t64-arm.exe", | ||
| "w32.exe", | ||
| "w64.exe", | ||
| "w64-arm.exe", | ||
| [tool.flit.sdist] | ||
| include = [ | ||
| "NEWS.rst", | ||
| "SECURITY.md", | ||
| "build-project/.python-version", | ||
| "build-project/build-project.py", | ||
| "build-project/build-requirements.in", | ||
| "build-project/build-requirements.txt", | ||
| "docs/requirements.txt", | ||
| "docs/**/*.css", | ||
| "docs/**/*.dot", | ||
| "docs/**/*.md", | ||
| "docs/**/*.png", | ||
| "docs/**/*.py", | ||
| "docs/**/*.rst", | ||
| ] | ||
| exclude = [ | ||
| "src/pip/_vendor/**/*.pyi", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why excluding this from the sdist?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That pattern was added in #4545 It's probably not doing anything anymore? I'll take a look later and remove it if redundant.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Vendoring generates stub files for packages which don't include a Which puts What's interesting about this, is it doesn't seem to work, at least mypy doesn't find the correct type hints for requests: #13476 I will try and investigate this, but I think the solution will be that we need to update vendoring to stop doing this, or do something more useful?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Vendoring does have some config that allows us to remove or rename these type stub files, which I may take advantage of in a different PR: https://github.com/pypa/pip/blob/25.2/pyproject.toml#L182
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the investigation. This does not sound blocking for this PR anyway. |
||
| ] | ||
notatallshaw marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ###################################################################################### | ||
|
|
@@ -362,3 +360,15 @@ 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", | ||
| ".gitattributes", | ||
| ".gitignore", | ||
| ".git-blame-ignore-revs", | ||
| ".mailmap", | ||
| ".readthedocs-custom-redirects.yml" | ||
| ] | ||
Uh oh!
There was an error while loading. Please reload this page.