mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
inspect: add experimental status warning
This commit is contained in:
parent
585136494e
commit
a7df613b78
|
@ -1,3 +1,4 @@
|
|||
import logging
|
||||
from optparse import Values
|
||||
from typing import Any, Dict, List
|
||||
|
||||
|
@ -12,6 +13,8 @@ from pip._internal.metadata import BaseDistribution, get_environment
|
|||
from pip._internal.utils.compat import stdlib_pkgs
|
||||
from pip._internal.utils.urls import path_to_url
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class InspectCommand(Command):
|
||||
"""
|
||||
|
@ -43,6 +46,11 @@ class InspectCommand(Command):
|
|||
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,
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue