Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
packaging(aspkg_resources._vendor.packaging)setuptools's vendored version ofpackagingincludes apy.typedfile in that directory, which causes stubtest to get confused when comparingpkg_resources._vendor.packagingin the stub withpkg_resources._vendor.packagingat runtime (see the failing CI in [stubsabot] Bump setuptools to 69.0.* #11049)pkg_resources._vendor.packagingfrom the stub, and just declare that the stubs have a dependency onpackaging. That doesn't pass our CI, however, becausepackagingisn't in the stub-uploader's allowlist -- and even if it were, it wouldn't pass our CI, becausesetuptoolsdoesn't declare a dependency onpackagingat runtime (it doesn't need to, since it vendorspackaging). See the failing CI in Update setuptools to v69 #11066.The "ridiculously dumb" solution is to continue vendoring
packagingin the stubs, much assetuptoolsdoes at runtime. But instead of putting the vendored version ofpackagingin apkg_resources._vendor.packagingdirectory (as it is at runtime), put it in apkg_resources._vendored_packagingdirectory instead.