Skip to content

Commit b5be1da

Browse files
authored
Merge pull request #11757 from sbidoul/inspect-and-install-reports-stable-sbi
Declare inspect and install reports formats to be stable
2 parents e32ec0a + 46ec936 commit b5be1da

File tree

8 files changed

+9
-35
lines changed

8 files changed

+9
-35
lines changed

docs/html/reference/inspect-report.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ environment, including installed distributions.
1010

1111
The report is a JSON object with the following properties:
1212

13-
- `version`: the string `0`, denoting that the inspect command is an experimental
14-
feature. This value will change to `1`, when the feature is deemed stable after
15-
gathering user feedback (likely in pip 22.3 or 23.0). Backward incompatible changes
16-
may be introduced in version `1` without notice. After that, it will change only if
13+
- `version`: the string `1`. It will change only if
1714
and when backward incompatible changes are introduced, such as removing mandatory
1815
fields or changing the semantics or data type of existing fields. The introduction of
1916
backward incompatible changes will follow the usual pip processes such as the
@@ -72,7 +69,7 @@ this (metadata abriged for brevity):
7269

7370
```json
7471
{
75-
"version": "0",
72+
"version": "1",
7673
"pip_version": "22.2.dev0",
7774
"installed": [
7875
{

docs/html/reference/installation-report.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ When considering use cases, please bear in mind that
2323

2424
The report is a JSON object with the following properties:
2525

26-
- `version`: the string `0`, denoting that the installation report is an experimental
27-
feature. This value will change to `1`, when the feature is deemed stable after
28-
gathering user feedback (likely in pip 22.3 or 23.0). Backward incompatible changes
29-
may be introduced in version `1` without notice. After that, it will change only if
26+
- `version`: the string `1`. It will change only if
3027
and when backward incompatible changes are introduced, such as removing mandatory
3128
fields or changing the semantics or data type of existing fields. The introduction of
3229
backward incompatible changes will follow the usual pip processes such as the
@@ -92,7 +89,7 @@ will produce an output similar to this (metadata abriged for brevity):
9289

9390
```json
9491
{
95-
"version": "0",
92+
"version": "1",
9693
"pip_version": "22.2",
9794
"install": [
9895
{

news/11757.feature.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
The inspect and installation report formats are now declared stabled, and their version
2+
has been bumped from ``0`` to ``1``.

src/pip/_internal/commands/inspect.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,14 @@ def add_options(self) -> None:
4646
self.parser.insert_option_group(0, self.cmd_opts)
4747

4848
def run(self, options: Values, args: List[str]) -> int:
49-
logger.warning(
50-
"pip inspect is currently an experimental command. "
51-
"The output format may change in a future release without prior warning."
52-
)
53-
5449
cmdoptions.check_list_path_option(options)
5550
dists = get_environment(options.path).iter_installed_distributions(
5651
local_only=options.local,
5752
user_only=options.user,
5853
skip=set(stdlib_pkgs),
5954
)
6055
output = {
61-
"version": "0",
56+
"version": "1",
6257
"pip_version": __version__,
6358
"installed": [self._dist_to_dict(dist) for dist in dists],
6459
"environment": default_environment(),

src/pip/_internal/commands/install.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -417,12 +417,6 @@ def run(self, options: Values, args: List[str]) -> int:
417417
)
418418

419419
if options.json_report_file:
420-
logger.warning(
421-
"--report is currently an experimental option. "
422-
"The output format may change in a future release "
423-
"without prior warning."
424-
)
425-
426420
report = InstallationReport(requirement_set.requirements_to_install)
427421
if options.json_report_file == "-":
428422
print_json(data=report.to_dict())

src/pip/_internal/models/installation_report.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def _install_req_to_dict(cls, ireq: InstallRequirement) -> Dict[str, Any]:
3838

3939
def to_dict(self) -> Dict[str, Any]:
4040
return {
41-
"version": "0",
41+
"version": "1",
4242
"pip_version": __version__,
4343
"install": [
4444
self._install_req_to_dict(ireq) for ireq in self._install_requirements

tests/functional/test_inspect.py

Lines changed: 1 addition & 1 deletion
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", allow_stderr_warning=True)
31+
result = simple_script.pip("inspect")
3232
report = json.loads(result.stdout)
3333
installed = report["installed"]
3434
assert len(installed) == 4

tests/functional/test_install_report.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ def test_install_report_basic(
2626
str(shared_data.root / "packages/"),
2727
"--report",
2828
str(report_path),
29-
allow_stderr_warning=True,
3029
)
3130
report = json.loads(report_path.read_text())
3231
assert "install" in report
@@ -59,7 +58,6 @@ def test_install_report_dep(
5958
str(shared_data.root / "packages/"),
6059
"--report",
6160
str(report_path),
62-
allow_stderr_warning=True,
6361
)
6462
report = json.loads(report_path.read_text())
6563
assert len(report["install"]) == 2
@@ -78,7 +76,6 @@ def test_install_report_index(script: PipTestEnvironment, tmp_path: Path) -> Non
7876
"Paste[openid]==1.7.5.1",
7977
"--report",
8078
str(report_path),
81-
allow_stderr_warning=True,
8279
)
8380
report = json.loads(report_path.read_text())
8481
assert len(report["install"]) == 2
@@ -114,7 +111,6 @@ def test_install_report_vcs_and_wheel_cache(
114111
str(cache_dir),
115112
"--report",
116113
str(report_path),
117-
allow_stderr_warning=True,
118114
)
119115
report = json.loads(report_path.read_text())
120116
assert len(report["install"]) == 1
@@ -142,7 +138,6 @@ def test_install_report_vcs_and_wheel_cache(
142138
str(cache_dir),
143139
"--report",
144140
str(report_path),
145-
allow_stderr_warning=True,
146141
)
147142
assert "Using cached pip_test_package" in result.stdout
148143
report = json.loads(report_path.read_text())
@@ -176,7 +171,6 @@ def test_install_report_vcs_editable(
176171
"#egg=pip-test-package",
177172
"--report",
178173
str(report_path),
179-
allow_stderr_warning=True,
180174
)
181175
report = json.loads(report_path.read_text())
182176
assert len(report["install"]) == 1
@@ -203,11 +197,6 @@ def test_install_report_to_stdout(
203197
str(shared_data.root / "packages/"),
204198
"--report",
205199
"-",
206-
allow_stderr_warning=True,
207-
)
208-
assert result.stderr == (
209-
"WARNING: --report is currently an experimental option. "
210-
"The output format may change in a future release without prior warning.\n"
211200
)
212201
report = json.loads(result.stdout)
213202
assert "install" in report

0 commit comments

Comments
 (0)