From d70edc8a9514cf5afa365193fa984ff73e353054 Mon Sep 17 00:00:00 2001 From: Xavier Fernandez Date: Thu, 18 Jul 2019 11:17:05 +0200 Subject: [PATCH 1/2] docs: add basic documentation for pip debug --- docs/html/reference/index.rst | 1 + docs/html/reference/pip_debug.rst | 23 +++++++++++++++++++++++ docs/man/commands/debug.rst | 20 ++++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 docs/html/reference/pip_debug.rst create mode 100644 docs/man/commands/debug.rst diff --git a/docs/html/reference/index.rst b/docs/html/reference/index.rst index f25568bfb15..f3312948193 100644 --- a/docs/html/reference/index.rst +++ b/docs/html/reference/index.rst @@ -17,3 +17,4 @@ Reference Guide pip_config pip_wheel pip_hash + pip_debug diff --git a/docs/html/reference/pip_debug.rst b/docs/html/reference/pip_debug.rst new file mode 100644 index 00000000000..e9489c3c2f2 --- /dev/null +++ b/docs/html/reference/pip_debug.rst @@ -0,0 +1,23 @@ +.. _`pip debug`: + +pip debug +----------- + +.. contents:: + +Usage +***** + +.. pip-command-usage:: debug + + +Description +*********** + +.. pip-command-description:: debug + + +Options +******* + +.. pip-command-options:: debug diff --git a/docs/man/commands/debug.rst b/docs/man/commands/debug.rst new file mode 100644 index 00000000000..9dda071b2d2 --- /dev/null +++ b/docs/man/commands/debug.rst @@ -0,0 +1,20 @@ +:orphan: + +========== +pip-debug +========== + +Description +*********** + +.. pip-command-description:: debug + +Usage +***** + +.. pip-command-usage:: debug + +Options +******* + +.. pip-command-options:: debug From ab10b8c328ab81cfec103715a8078b25d3523f65 Mon Sep 17 00:00:00 2001 From: Xavier Fernandez Date: Thu, 18 Jul 2019 11:32:26 +0200 Subject: [PATCH 2/2] debug: add warnings about its provisional status --- docs/html/reference/pip_debug.rst | 5 +++++ docs/man/commands/debug.rst | 6 ++++++ src/pip/_internal/commands/debug.py | 6 ++++++ tests/functional/test_debug.py | 4 ++-- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/docs/html/reference/pip_debug.rst b/docs/html/reference/pip_debug.rst index e9489c3c2f2..8e8b21b5183 100644 --- a/docs/html/reference/pip_debug.rst +++ b/docs/html/reference/pip_debug.rst @@ -11,6 +11,11 @@ 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 *********** diff --git a/docs/man/commands/debug.rst b/docs/man/commands/debug.rst index 9dda071b2d2..b27ef2b550d 100644 --- a/docs/man/commands/debug.rst +++ b/docs/man/commands/debug.rst @@ -14,6 +14,12 @@ 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 ******* diff --git a/src/pip/_internal/commands/debug.py b/src/pip/_internal/commands/debug.py index 99b5b946f8a..84d06179c06 100644 --- a/src/pip/_internal/commands/debug.py +++ b/src/pip/_internal/commands/debug.py @@ -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) diff --git a/tests/functional/test_debug.py b/tests/functional/test_debug.py index 3f5374722da..e7a37616b60 100644 --- a/tests/functional/test_debug.py +++ b/tests/functional/test_debug.py @@ -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 @@ -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