pip inspect format declared stable

This commit is contained in:
Stéphane Bidoul 2023-01-28 13:48:14 +01:00
parent e69e265cb7
commit 99dddc1616
3 changed files with 4 additions and 12 deletions

View File

@ -10,10 +10,7 @@ environment, including installed distributions.
The report is a JSON object with the following properties:
- `version`: the string `0`, denoting that the inspect command is an experimental
feature. This value will change to `1`, when the feature is deemed stable after
gathering user feedback (likely in pip 22.3 or 23.0). Backward incompatible changes
may be introduced in version `1` without notice. After that, it will change only if
- `version`: the string `1`. It will change only if
and when backward incompatible changes are introduced, such as removing mandatory
fields or changing the semantics or data type of existing fields. The introduction of
backward incompatible changes will follow the usual pip processes such as the
@ -72,7 +69,7 @@ this (metadata abriged for brevity):
```json
{
"version": "0",
"version": "1",
"pip_version": "22.2.dev0",
"installed": [
{

View File

@ -46,11 +46,6 @@ 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,
@ -58,7 +53,7 @@ class InspectCommand(Command):
skip=set(stdlib_pkgs),
)
output = {
"version": "0",
"version": "1",
"pip_version": __version__,
"installed": [self._dist_to_dict(dist) for dist in dists],
"environment": default_environment(),

View File

@ -28,7 +28,7 @@ def test_inspect_basic(simple_script: PipTestEnvironment) -> None:
"""
Test default behavior of inspect command.
"""
result = simple_script.pip("inspect", allow_stderr_warning=True)
result = simple_script.pip("inspect")
report = json.loads(result.stdout)
installed = report["installed"]
assert len(installed) == 4