Skip to content

Commit

Permalink
Install report format declared stable
Browse files Browse the repository at this point in the history
  • Loading branch information
sbidoul committed Jan 28, 2023
1 parent 2724a5f commit d910381
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 23 deletions.
7 changes: 2 additions & 5 deletions docs/html/reference/installation-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ When considering use cases, please bear in mind that

The report is a JSON object with the following properties:

- `version`: the string `0`, denoting that the installation report 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
Expand Down Expand Up @@ -92,7 +89,7 @@ will produce an output similar to this (metadata abriged for brevity):

```json
{
"version": "0",
"version": "1",
"pip_version": "22.2",
"install": [
{
Expand Down
6 changes: 0 additions & 6 deletions src/pip/_internal/commands/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,12 +417,6 @@ def run(self, options: Values, args: List[str]) -> int:
)

if options.json_report_file:
logger.warning(
"--report is currently an experimental option. "
"The output format may change in a future release "
"without prior warning."
)

report = InstallationReport(requirement_set.requirements_to_install)
if options.json_report_file == "-":
print_json(data=report.to_dict())
Expand Down
2 changes: 1 addition & 1 deletion src/pip/_internal/models/installation_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def _install_req_to_dict(cls, ireq: InstallRequirement) -> Dict[str, Any]:

def to_dict(self) -> Dict[str, Any]:
return {
"version": "0",
"version": "1",
"pip_version": __version__,
"install": [
self._install_req_to_dict(ireq) for ireq in self._install_requirements
Expand Down
11 changes: 0 additions & 11 deletions tests/functional/test_install_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def test_install_report_basic(
str(shared_data.root / "packages/"),
"--report",
str(report_path),
allow_stderr_warning=True,
)
report = json.loads(report_path.read_text())
assert "install" in report
Expand Down Expand Up @@ -59,7 +58,6 @@ def test_install_report_dep(
str(shared_data.root / "packages/"),
"--report",
str(report_path),
allow_stderr_warning=True,
)
report = json.loads(report_path.read_text())
assert len(report["install"]) == 2
Expand All @@ -78,7 +76,6 @@ def test_install_report_index(script: PipTestEnvironment, tmp_path: Path) -> Non
"Paste[openid]==1.7.5.1",
"--report",
str(report_path),
allow_stderr_warning=True,
)
report = json.loads(report_path.read_text())
assert len(report["install"]) == 2
Expand Down Expand Up @@ -114,7 +111,6 @@ def test_install_report_vcs_and_wheel_cache(
str(cache_dir),
"--report",
str(report_path),
allow_stderr_warning=True,
)
report = json.loads(report_path.read_text())
assert len(report["install"]) == 1
Expand Down Expand Up @@ -142,7 +138,6 @@ def test_install_report_vcs_and_wheel_cache(
str(cache_dir),
"--report",
str(report_path),
allow_stderr_warning=True,
)
assert "Using cached pip_test_package" in result.stdout
report = json.loads(report_path.read_text())
Expand Down Expand Up @@ -176,7 +171,6 @@ def test_install_report_vcs_editable(
"#egg=pip-test-package",
"--report",
str(report_path),
allow_stderr_warning=True,
)
report = json.loads(report_path.read_text())
assert len(report["install"]) == 1
Expand All @@ -203,11 +197,6 @@ def test_install_report_to_stdout(
str(shared_data.root / "packages/"),
"--report",
"-",
allow_stderr_warning=True,
)
assert result.stderr == (
"WARNING: --report is currently an experimental option. "
"The output format may change in a future release without prior warning.\n"
)
report = json.loads(result.stdout)
assert "install" in report
Expand Down

0 comments on commit d910381

Please sign in to comment.