-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Ensure */extern/__init__.py
is in sync with */_vendor/vendored.txt
#4320
Conversation
…urces with vendored.txt
2845e41
to
86770ba
Compare
'jaraco', | ||
'importlib_resources', | ||
'zipp', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jaraco, zipp
was not in this pkg_resources/extern/__init__.py
, but the vendored.txt
file says:
# required for importlib_resources on older Pythons zipp==3.7.0
Maybe that was a bug? Or is "older Pythons" here referring to Python < 3.7? In that case maybe we can remove it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure what older Pythons means, as it's dependent on the version of importlib_resources that's resolved. I would keep a version compatible with whatever importlib_resources declares.
names = ( | ||
'packaging', | ||
'platformdirs', | ||
'typing_extensions', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was not listed. The vendored.txt
file says the following:
# required for platformdirs on Python < 3.8
typing_extensions==4.4.0
But now we removed support to Python < 3.8, so I guess we can remove this vendored dependency?
'importlib_resources', | ||
'importlib_metadata', | ||
'typing_extensions', | ||
'zipp', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor change: automatic reordering, just so it matches vendored.txt
.
@@ -9,5 +9,7 @@ jaraco.text==3.7.0 | |||
importlib_resources==5.10.2 | |||
# required for importlib_resources on older Pythons | |||
zipp==3.7.0 | |||
# required for jaraco.functools | |||
more_itertools==10.2.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this here because it was listed in pkg_resources.extern.names
.
The version corresponds to the version that already exists in the pkg_resources/_vendor
the directory... But that is different from the version in setuptools/_vendor/vendored.txt
. Maybe we should synchronise these versions so that it makes the life easier for downstream packagers "de-vendoring" setuptools?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking care of this. I've never loved the two-step manual sync aspect of the vendoring design. I've been thinking we may be able to simplify it by merely adding _vendor
to sys.path
(and eliminating extern altogether), but I haven't experimented with that and I'm unsure what dragons might lurk in that approach.
'jaraco', | ||
'importlib_resources', | ||
'zipp', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure what older Pythons means, as it's dependent on the version of importlib_resources that's resolved. I would keep a version compatible with whatever importlib_resources declares.
*/extern/__init__.py
is in sync wiht */_vendor/vendored.txt
*/extern/__init__.py
is in sync with */_vendor/vendored.txt
@jaraco Eliminating |
I think we can go with this one for now and any improvements can follow up. I also opened other issues for the comments we left.
Yeah, that would be good. The obvious drawback is the dependency clash if other packages installed in the same environment require conflicting versions. A different approach (as referred by @Avasam) would be to eliminate the MetaPathFinder (and therefore the |
Sometimes I have the feeling that the vendored packages,
_vendor/vendored.txt
andextern/__init__.py
drift apart. This is an attempt to minimise that.Please feel free to close if you don't think this is relevant.
tox -e vendor
in this PR.Summary of changes
cog
script that attempts to derive the*.extern.names
from the*/_vendor/vendored.txt
filetools/vendored.py
tox -e vendor
to automatically runcog
tox -e check-extern
.more_itertools
topkg_resources/_vendor/vendored.txt
? (maybe it was missing?)Closes
Pull Request Checklist
newsfragments/
.(See documentation for details)