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

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

Conversation

Avasam
Copy link
Contributor

@Avasam Avasam commented Oct 17, 2024

Summary of changes

Note: Please consider #4704 as an alternative !

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. Do note it has to exist in a folder named distutils or distutils-stubs, preferably by itself.

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.

@Avasam Avasam force-pushed the vendor-distutils-stubs branch 2 times, most recently from b1fec5c to 7ea98d5 Compare October 17, 2024 23:30
@Avasam Avasam force-pushed the vendor-distutils-stubs branch 2 times, most recently from 98e4484 to c440538 Compare October 21, 2024 20:37
@Avasam Avasam force-pushed the vendor-distutils-stubs branch from c440538 to 3dd8b4e Compare October 25, 2024 15:47
@Avasam Avasam force-pushed the vendor-distutils-stubs branch 2 times, most recently from c01d02b to 53ed329 Compare October 25, 2024 17:44
@Avasam Avasam force-pushed the vendor-distutils-stubs branch from 53ed329 to 20bda1b Compare October 25, 2024 17:46
@Avasam Avasam mentioned this pull request Oct 26, 2024
1 task
@Avasam Avasam marked this pull request as draft October 26, 2024 19:52
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