-
Notifications
You must be signed in to change notification settings - Fork 3k
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
pip debug: Add versions of vendored libraries to output #7887
pip debug: Add versions of vendored libraries to output #7887
Conversation
8376078
to
3ffbe69
Compare
@NoahGorny thanks for taking a look. The goal is however not to print the values of vendor.txt but in the case of an unbundled pip to quickly find faulty versions (so including vendor.txt to compare the expected version vs installed version is still useful). I think you should start by printing pip/src/pip/_vendor/__init__.py Line 17 in f6b5b40
And something like:
(and devise a way to deal with libraries that do not include their versions) Is it more clear ? |
I see, I'll work on it in the following days :) |
3ffbe69
to
40b0718
Compare
@xavfernandez I make some work, tell me what you think
anyway, thanks alot for the feedback 😄 |
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.
not sure this is what you expect me to do in this situation
For debundled modules without __version__
attribute, I'd be tempted to check their module.__file__
attribute to find there location and their metadata:
Something like:
>>> pip._vendor.retrying.__file__
'/usr/lib/python3.8/site-packages/retrying.py'
>>> pkg_resources.WorkingSet([os.path.dirname(pip._vendor.retrying.__file__)]).find(pkg_resources.Requirement('retrying')).version
'1.3.3'
40b0718
to
ae0a446
Compare
what do think about this now @xavfernandez? I also added a simple test |
seems like |
ae0a446
to
986e1bd
Compare
@xavfernandez any updates? I think its pretty ready |
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 is not far from ready and this would be nice to have in 20.1 :) cc @pradyunsg
986e1bd
to
1246673
Compare
src/pip/_internal/commands/debug.py
Outdated
logger.info('vendored library versions:') | ||
|
||
vendor_txt_versions = create_vendor_txt_map() | ||
show_actual_vendor_versions(vendor_txt_versions) |
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.
A with indent_log():
would be prettier IMHO:
vendored library versions:
appdirs==1.4.3
CacheControl==0.12.6
...
vs
vendored library versions:
appdirs==1.4.3
CacheControl==0.12.6
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 see, updated the code to include it- nice idea!
1246673
to
e6f109b
Compare
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.
One final nit, otherwise it looks ready 👍
e6f109b
to
bfd17cb
Compare
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 your work @NoahGorny 👍
Happy to help 😄 |
Thanks for the PR @NoahGorny! ^>^ |
Resolves #7794
@pradyunsg you can take a look :)