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

Add a "pip debug" command #6638

Merged
merged 4 commits into from Jul 2, 2019

Conversation

@cjerdonek
Copy link
Member

commented Jun 23, 2019

This PR implements an initial pip debug command, as suggested / discussed e.g. recently here (in issue #4228) and much earlier here (in issue #5813).

The initial implementation is focused mainly on listing the compatible tags (e.g. the output of pep425tags.get_supported()), since that need has come up in a number of issues. One feature of the current implementation is that it accepts the same --platform, --python-version, --implementation, and --abi options that pip download and install accept. This will help with issues like that expressed in #6121, where currently people have no way of knowing what tags result when they provide certain options. This command gives people a way to experiment and try different things.

The command also gives people a way to experiment in response to failures to match candidate wheels, e.g. using the new log messages introduced in PR #6540.

Also, by default the command shows only the first 10 tags (though we can change this number). Passing --verbose shows all of them (which can be in the several hundreds). Either way, the total count is shown in the first line next to "Compatible tags," along with the tag-related option values that were provided explicitly by the user.

$ pip debug --platform linux_x86_64
pip version: pip 19.2.dev0 from /.../pip/src/pip (python 3.6) (i.e. same output as pip --version)
sys.version: ...
sys.executable: /.../pip/bin/python3.6
sys.platform: darwin
sys.implementation
  name: cpython
Compatible tags: 18 (target: platform='linux_x86_64')
  cp36-cp36m-linux_x86_64
  cp36-abi3-linux_x86_64
  cp36-none-linux_x86_64
  cp35-abi3-linux_x86_64
  cp34-abi3-linux_x86_64
  cp33-abi3-linux_x86_64
  cp32-abi3-linux_x86_64
  py3-none-linux_x86_64
  cp36-none-any
  cp3-none-any
  ...
  [First 10 tags shown. Pass --verbose to show all.]

@cjerdonek cjerdonek force-pushed the cjerdonek:debug-command branch from 60b7b82 to 651a752 Jun 23, 2019

@cjerdonek cjerdonek force-pushed the cjerdonek:debug-command branch 3 times, most recently from 64a719d to fe933d2 Jun 23, 2019

src/pip/_internal/commands/debug.py Outdated Show resolved Hide resolved
src/pip/_internal/models/target_python.py Outdated Show resolved Hide resolved
src/pip/_internal/utils/misc.py Show resolved Hide resolved
src/pip/_internal/commands/debug.py Outdated Show resolved Hide resolved

@cjerdonek cjerdonek force-pushed the cjerdonek:debug-command branch 2 times, most recently from 536c295 to 3b35cfd Jun 23, 2019

@cjerdonek

This comment has been minimized.

Copy link
Member Author

commented Jun 23, 2019

Thanks for the quick review, @pradyunsg! I incorporated all of your suggestions (all great).

@cjerdonek

This comment has been minimized.

Copy link
Member Author

commented Jun 23, 2019

I also added a few functional tests.

@cjerdonek cjerdonek force-pushed the cjerdonek:debug-command branch from 3b35cfd to 6c87f12 Jun 23, 2019

@cjerdonek cjerdonek force-pushed the cjerdonek:debug-command branch from 11aeb30 to d67acca Jun 27, 2019

@cjerdonek

This comment has been minimized.

Copy link
Member Author

commented Jun 30, 2019

@xavfernandez Any thoughts? We can grow this output over time as I'm sure there are many things missing.

@xavfernandez
Copy link
Contributor

left a comment

This is a really good start 👍
It would also need basic documentation (at least a docs/html/reference/pip_debug.rst) and most importantly (IMHO), strongly emphasize that the output and the options of this command are provisional and might change without notice.

@cjerdonek cjerdonek merged commit a8510bc into pypa:master Jul 2, 2019

29 checks passed

Linux Build #20190627.6 succeeded
Details
Linux (Package) Package succeeded
Details
Linux (Test Primary Python27) Test Primary Python27 succeeded
Details
Linux (Test Primary Python36) Test Primary Python36 succeeded
Details
Linux (Test Secondary Python34) Test Secondary Python34 succeeded
Details
Linux (Test Secondary Python35) Test Secondary Python35 succeeded
Details
Linux (Test Secondary Python37) Test Secondary Python37 succeeded
Details
Windows Build #20190627.6 succeeded
Details
Windows (Package) Package succeeded
Details
Windows (Test Primary Python27-x64) Test Primary Python27-x64 succeeded
Details
Windows (Test Primary Python36-x64) Test Primary Python36-x64 succeeded
Details
Windows (Test Secondary Python27-x86) Test Secondary Python27-x86 succeeded
Details
Windows (Test Secondary Python34-x64) Test Secondary Python34-x64 succeeded
Details
Windows (Test Secondary Python34-x86) Test Secondary Python34-x86 succeeded
Details
Windows (Test Secondary Python35-x64) Test Secondary Python35-x64 succeeded
Details
Windows (Test Secondary Python35-x86) Test Secondary Python35-x86 succeeded
Details
Windows (Test Secondary Python36-x86) Test Secondary Python36-x86 succeeded
Details
Windows (Test Secondary Python37-x64) Test Secondary Python37-x64 succeeded
Details
Windows (Test Secondary Python37-x86) Test Secondary Python37-x86 succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
macOS Build #20190627.6 succeeded
Details
macOS (Package) Package succeeded
Details
macOS (Test Primary Python27) Test Primary Python27 succeeded
Details
macOS (Test Primary Python36) Test Primary Python36 succeeded
Details
macOS (Test Secondary Python34) Test Secondary Python34 succeeded
Details
macOS (Test Secondary Python35) Test Secondary Python35 succeeded
Details
macOS (Test Secondary Python37) Test Secondary Python37 succeeded
Details
news-file/pr News files updated and/or change is trivial.
Details

@cjerdonek cjerdonek deleted the cjerdonek:debug-command branch Jul 2, 2019

@cjerdonek

This comment has been minimized.

Copy link
Member Author

commented Jul 2, 2019

Thanks again, @pradyunsg and @xavfernandez. I merged this and added issue #6672 for the docs suggestion that @xavfernandez made.

@pradyunsg

This comment has been minimized.

Copy link
Member

commented Jul 2, 2019

Hurrah! :D

@lock lock bot added the S: auto-locked label Aug 1, 2019

@lock lock bot locked as resolved and limited conversation to collaborators Aug 1, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants
You can’t perform that action at this time.