Skip to content

Commit 9ff66f6

Browse files
committed
inspect: add experimental status warning
1 parent c3ff673 commit 9ff66f6

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/pip/_internal/commands/inspect.py

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import logging
12
from optparse import Values
23
from typing import Any, Dict, List
34

@@ -12,6 +13,8 @@
1213
from pip._internal.utils.compat import stdlib_pkgs
1314
from pip._internal.utils.urls import path_to_url
1415

16+
logger = logging.getLogger(__name__)
17+
1518

1619
class InspectCommand(Command):
1720
"""
@@ -44,6 +47,11 @@ def add_options(self) -> None:
4447
self.parser.insert_option_group(0, self.cmd_opts)
4548

4649
def run(self, options: Values, args: List[str]) -> int:
50+
logger.warning(
51+
"pip inspect is currently an experimental command. "
52+
"The output format may change in a future release without prior warning."
53+
)
54+
4755
cmdoptions.check_list_path_option(options)
4856
dists = get_environment(options.path).iter_installed_distributions(
4957
local_only=options.local,

tests/functional/test_inspect.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def test_inspect_basic(simple_script: PipTestEnvironment) -> None:
2828
"""
2929
Test default behavior of inspect command.
3030
"""
31-
result = simple_script.pip("inspect")
31+
result = simple_script.pip("inspect", allow_stderr_warning=True)
3232
report = json.loads(result.stdout)
3333
installed = report["installed"]
3434
assert len(installed) == 4

0 commit comments

Comments
 (0)