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 basic debug doc #6731

Merged
merged 2 commits into from
Jul 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/html/reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ Reference Guide
pip_config
pip_wheel
pip_hash
pip_debug
28 changes: 28 additions & 0 deletions docs/html/reference/pip_debug.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.. _`pip debug`:

pip debug
-----------

.. contents::

Usage
*****

.. pip-command-usage:: debug


.. warning::
This command is only meant for debugging.
Its options and outputs are provisional and may change without notice.


Description
***********

.. pip-command-description:: debug


Options
*******

.. pip-command-options:: debug
26 changes: 26 additions & 0 deletions docs/man/commands/debug.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
:orphan:

==========
pip-debug
==========

Description
***********

.. pip-command-description:: debug

Usage
*****

.. pip-command-usage:: debug


.. warning::
This command is only meant for debugging.
Its options and outputs are provisional and may change without notice.


Options
*******

.. pip-command-options:: debug
6 changes: 6 additions & 0 deletions src/pip/_internal/commands/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ def __init__(self, *args, **kw):

def run(self, options, args):
# type: (Values, List[Any]) -> int
logger.warning(
"This command is only meant for debugging. "
"Do not use this with automation for parsing and getting these "
"details, since the output and options of this command may "
"change without notice."
)
show_value('pip version', get_pip_version())
show_value('sys.version', sys.version)
show_value('sys.executable', sys.executable)
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/test_debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def test_debug(script, args):
Check simple option cases.
"""
args = ['debug'] + args
result = script.pip(*args)
result = script.pip(*args, allow_stderr_warning=True)
stdout = result.stdout

assert 'sys.executable: ' in stdout
Expand Down Expand Up @@ -43,7 +43,7 @@ def test_debug__target_options(script, args, expected):
Check passing target-related options.
"""
args = ['debug'] + args
result = script.pip(*args)
result = script.pip(*args, allow_stderr_warning=True)
stdout = result.stdout

assert 'Compatible tags: ' in stdout
Expand Down