Skip to content

Commit f18601d

Browse files
committed
install report: add version field
Also, affirm the experimental status of the feature.
1 parent 60c2d30 commit f18601d

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

docs/html/reference/installation-report.md

+9
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ it did install (or what it would have installed, if used with the `--dry-run` op
77

88
The report is a JSON object with the following properties:
99

10+
- `version`: the string `0`, denoting that the installation report is an experimental
11+
feature. This value will change to `1` in pip 22.3 or 23.0 when the feature is deemed
12+
stable after gathering user feedback. Backward incompatible changes may be introduced
13+
in version `1` without notice. After that, it will change only if and when backward
14+
incompatible changes are introduced, such as removing mandatory fields or changing the
15+
semantics or data type of existing fields. The introduction of backward incompatible
16+
changes will follow the usual pip processes such as the deprecation cycle or feature
17+
flags. Tools must check this field to ensure they support the corresponding version.
1018
- `pip_version`: a string with the version of pip used to produce the report.
1119
- `install`: an object where the properties are the canonicalized names of the
1220
distribution packages (to be) installed and the values are of type
@@ -52,6 +60,7 @@ will produce an output similar to this (metadata abriged for clarity):
5260

5361
```json
5462
{
63+
"version": "0",
5564
"pip_version": "22.2",
5665
"install": {
5766
"pydantic": {

news/53.feature.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
Add ``--report`` to the install command to generate a json report of what was installed.
2-
In combination with ``--dry-run`` and ``--ignore-installed`` it can be used to resolve
3-
the requirements.
1+
Add an experimental ``--report`` option to the install command to generate a json report
2+
of what was installed. In combination with ``--dry-run`` and ``--ignore-installed`` it
3+
can be used to resolve the requirements.

src/pip/_internal/models/installation_report.py

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def _install_req_to_dict(cls, ireq: InstallRequirement) -> Dict[str, Any]:
3939

4040
def to_dict(self) -> Dict[str, Any]:
4141
return {
42+
"version": "0",
4243
"pip_version": __version__,
4344
"install": {
4445
canonicalize_name(ireq.metadata["Name"]): self._install_req_to_dict(

0 commit comments

Comments
 (0)