Skip to content

Commit 074c6b5

Browse files
committed
install report: added experimental status warning
1 parent 16029fb commit 074c6b5

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/pip/_internal/commands/install.py

+6
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,12 @@ def run(self, options: Values, args: List[str]) -> int:
371371
)
372372

373373
if options.json_report_file:
374+
logger.warning(
375+
"--report is currently an experimental option. "
376+
"The output format may change in a future release "
377+
"without prior warning."
378+
)
379+
374380
report = InstallationReport(requirement_set.requirements_to_install)
375381
if options.json_report_file == "-":
376382
print_json(data=report.to_dict())

tests/functional/test_install_report.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def test_install_report_basic(
2626
str(shared_data.root / "packages/"),
2727
"--report",
2828
str(report_path),
29+
allow_stderr_warning=True,
2930
)
3031
report = json.loads(report_path.read_text())
3132
assert "install" in report
@@ -58,6 +59,7 @@ def test_install_report_dep(
5859
str(shared_data.root / "packages/"),
5960
"--report",
6061
str(report_path),
62+
allow_stderr_warning=True,
6163
)
6264
report = json.loads(report_path.read_text())
6365
assert len(report["install"]) == 2
@@ -76,6 +78,7 @@ def test_install_report_index(script: PipTestEnvironment, tmp_path: Path) -> Non
7678
"Paste[openid]==1.7.5.1",
7779
"--report",
7880
str(report_path),
81+
allow_stderr_warning=True,
7982
)
8083
report = json.loads(report_path.read_text())
8184
assert len(report["install"]) == 2
@@ -111,6 +114,7 @@ def test_install_report_vcs_and_wheel_cache(
111114
str(cache_dir),
112115
"--report",
113116
str(report_path),
117+
allow_stderr_warning=True,
114118
)
115119
report = json.loads(report_path.read_text())
116120
assert len(report["install"]) == 1
@@ -138,6 +142,7 @@ def test_install_report_vcs_and_wheel_cache(
138142
str(cache_dir),
139143
"--report",
140144
str(report_path),
145+
allow_stderr_warning=True,
141146
)
142147
assert "Using cached pip_test_package" in result.stdout
143148
report = json.loads(report_path.read_text())
@@ -171,6 +176,7 @@ def test_install_report_vcs_editable(
171176
"#egg=pip-test-package",
172177
"--report",
173178
str(report_path),
179+
allow_stderr_warning=True,
174180
)
175181
report = json.loads(report_path.read_text())
176182
assert len(report["install"]) == 1
@@ -197,8 +203,12 @@ def test_install_report_to_stdout(
197203
str(shared_data.root / "packages/"),
198204
"--report",
199205
"-",
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"
200211
)
201-
assert not result.stderr
202212
report = json.loads(result.stdout)
203213
assert "install" in report
204214
assert len(report["install"]) == 1

0 commit comments

Comments
 (0)