Skip to content
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

Vendor distutils stubs #4691

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

Avasam
Copy link
Contributor

@Avasam Avasam commented Oct 17, 2024

Summary of changes

See commit history. Basically I copied stdlib/distutils from typeshed, then applied stubs/setuptools/_distutils from typeshed on top.
The following "fixups" have been brought back into typeshed and pypa/distutils, if you want we could wait for them to be merged and then I can rebase my changes here so reduce the amount of changes in my "fixups" commit:

I think these could go directly in https://github.com/pypa/distutils, vendoring them back into setuptools using the already existing process, to make it possibly easier to keep stubs and implementation in sync. But increasing the charge of pypa/distutils contributors.

Closes #4689

Pull Request Checklist

  • Changes have tests (these fix tests going forward :D )
  • News fragment added in newsfragments/. (no public facing changes as long as they're not published)
    (See documentation for details)

Comment on lines +206 to +209
# TODO: Include distutils stubs with package once we're confident in them
# "typings/distutils-stubs",
Copy link
Contributor Author

@Avasam Avasam Oct 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to ship anything as long as typeshed provides stubs for setuptools/_distutils. We can synchronize once ready.
As I mentioned in the issue, there's also always the option to ship it as a different package (in which case it could live completely separately from setuptools and pypa/distutils)

Comment on lines +21 to +22
# Use our custom stubs for distutils
mypy_path = $MYPY_CONFIG_FILE_DIR/typings
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used pyright's default of typings so that I didn't have to configure it there. But that folder name can be arbitrary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FR] Vendor distutils stubs
1 participant