Skip to content

Commit e916124

Browse files
authored
Merge pull request #6731 from xavfernandez/xfernandez/add_basic_debug_doc
Add basic debug doc
2 parents 8f45aee + ab10b8c commit e916124

File tree

5 files changed

+63
-2
lines changed

5 files changed

+63
-2
lines changed

docs/html/reference/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ Reference Guide
1717
pip_config
1818
pip_wheel
1919
pip_hash
20+
pip_debug

docs/html/reference/pip_debug.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
.. _`pip debug`:
2+
3+
pip debug
4+
-----------
5+
6+
.. contents::
7+
8+
Usage
9+
*****
10+
11+
.. pip-command-usage:: debug
12+
13+
14+
.. warning::
15+
This command is only meant for debugging.
16+
Its options and outputs are provisional and may change without notice.
17+
18+
19+
Description
20+
***********
21+
22+
.. pip-command-description:: debug
23+
24+
25+
Options
26+
*******
27+
28+
.. pip-command-options:: debug

docs/man/commands/debug.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
:orphan:
2+
3+
==========
4+
pip-debug
5+
==========
6+
7+
Description
8+
***********
9+
10+
.. pip-command-description:: debug
11+
12+
Usage
13+
*****
14+
15+
.. pip-command-usage:: debug
16+
17+
18+
.. warning::
19+
This command is only meant for debugging.
20+
Its options and outputs are provisional and may change without notice.
21+
22+
23+
Options
24+
*******
25+
26+
.. pip-command-options:: debug

src/pip/_internal/commands/debug.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ def __init__(self, *args, **kw):
9191

9292
def run(self, options, args):
9393
# type: (Values, List[Any]) -> int
94+
logger.warning(
95+
"This command is only meant for debugging. "
96+
"Do not use this with automation for parsing and getting these "
97+
"details, since the output and options of this command may "
98+
"change without notice."
99+
)
94100
show_value('pip version', get_pip_version())
95101
show_value('sys.version', sys.version)
96102
show_value('sys.executable', sys.executable)

tests/functional/test_debug.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def test_debug(script, args):
1515
Check simple option cases.
1616
"""
1717
args = ['debug'] + args
18-
result = script.pip(*args)
18+
result = script.pip(*args, allow_stderr_warning=True)
1919
stdout = result.stdout
2020

2121
assert 'sys.executable: ' in stdout
@@ -43,7 +43,7 @@ def test_debug__target_options(script, args, expected):
4343
Check passing target-related options.
4444
"""
4545
args = ['debug'] + args
46-
result = script.pip(*args)
46+
result = script.pip(*args, allow_stderr_warning=True)
4747
stdout = result.stdout
4848

4949
assert 'Compatible tags: ' in stdout

0 commit comments

Comments
 (0)