Skip to content

Commit

Permalink
inspect: add experimental status warning
Browse files Browse the repository at this point in the history
  • Loading branch information
sbidoul committed Jul 15, 2022
1 parent 5851364 commit a7df613
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/pip/_internal/commands/inspect.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
from optparse import Values
from typing import Any, Dict, List

Expand All @@ -12,6 +13,8 @@
from pip._internal.utils.compat import stdlib_pkgs
from pip._internal.utils.urls import path_to_url

logger = logging.getLogger(__name__)


class InspectCommand(Command):
"""
Expand Down Expand Up @@ -43,6 +46,11 @@ def add_options(self) -> None:
self.parser.insert_option_group(0, self.cmd_opts)

def run(self, options: Values, args: List[str]) -> int:
logger.warning(
"pip inspect is currently an experimental command. "
"The output format may change in a future release without prior warning."
)

cmdoptions.check_list_path_option(options)
dists = get_environment(options.path).iter_installed_distributions(
local_only=options.local,
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def test_inspect_basic(simple_script: PipTestEnvironment) -> None:
"""
Test default behavior of inspect command.
"""
result = simple_script.pip("inspect")
result = simple_script.pip("inspect", allow_stderr_warning=True)
report = json.loads(result.stdout)
installed = report["installed"]
assert len(installed) == 4
Expand Down

0 comments on commit a7df613

Please sign in to comment.