8000 Bump setuptools to 69.0.* by AlexWaygood · Pull Request #11069 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

Bump setuptools to 69.0.* #11069

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

Merged
merged 3 commits into from
Nov 28, 2023
Merged

Conversation

AlexWaygood
Copy link
Member

Closes #11049
Closes #11066 (cc. @Avasam -- but I've listed you as a co-author, as I used your work for the second commit here :)

Here's the problem:

  • At runtime, setuptools vendors packaging (as pkg_resources._vendor.packaging)
  • We used to do that in the stubs too, to accurately reflect the situation at runtime. Now, though, setuptools's vendored version of packaging includes a py.typed file in that directory, which causes stubtest to get confused when comparing pkg_resources._vendor.packaging in the stub with pkg_resources._vendor.packaging at runtime (see the failing CI in [stubsabot] Bump setuptools to 69.0.* #11049)
  • The obvious solution is to delete pkg_resources._vendor.packaging from the stub, and just declare that the stubs have a dependency on packaging. That doesn't pass our CI, however, because packaging isn't in the stub-uploader's allowlist -- and even if it were, it wouldn't pass our CI, because setuptools doesn't declare a dependency on packaging at runtime (it doesn't need to, since it vendors packaging). See the failing CI in Update setuptools to v69 #11066.

The "ridiculously dumb" solution is to continue vendoring packaging in the stubs, much as setuptools does at runtime. But instead of putting the vendored version of packaging in a pkg_resources._vendor.packaging directory (as it is at runtime), put it in a pkg_resources._vendored_packaging directory instead.

AlexWaygood and others added 2 commits November 25, 2023 21:18
Co-authored-by: Avasam <samuel.06@hotmail.com>

This comment has been minimized.

@Avasam
Copy link
Collaborator
Avasam commented Nov 28, 2023

I don't see a better solution. This is basically the same as when we create a shim for classes/methods we can't import. So we at least get the correct signatures.

Co-authored-by: Avasam <samuel.06@hotmail.com>
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@AlexWaygood AlexWaygood requested a review from Avasam November 28, 2023 22:05
Copy link
Collaborator
@Avasam Avasam left a comment

Choose a reason for hiding this comment

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

As mentioned in a previous comment:

I don't see a better solution [without introducing a change or special-casing in mypy/stubtest or stubuploader]. This is basically the same as when we create a shim for classes/methods we can't import. So we at least get the correct signatures.

Not the most straightforward PR to start with as a new maintainer :P But if you feel confident this doesn't need anyone else's review I'll go ahead and merge.

@AlexWaygood
Copy link
Member Author

Not the most straightforward PR to start with as a new maintainer :P

Indeed not, but you're hardly new around here, eh ;)

@AlexWaygood AlexWaygood merged commit e7c57b5 into python:main Nov 28, 2023
@AlexWaygood AlexWaygood deleted the setuptools-silly branch November 28, 2023 22:23
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.

2 participants
0