Skip to content

Commit 1fbfdc4

Browse files
committed
install report: add version field
Also, affirm the experimental status of the feature.
1 parent 2841f46 commit 1fbfdc4

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

docs/html/reference/installation-report.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ 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`, when the feature is deemed stable after
12+
gathering user feedback (likely in pip 22.3 or 23.0). Backward incompatible changes
13+
may be introduced in version `1` without notice. After that, it will change only if
14+
and when backward incompatible changes are introduced, such as removing mandatory
15+
fields or changing the semantics or data type of existing fields. The introduction of
16+
backward incompatible changes will follow the usual pip processes such as the
17+
deprecation cycle or feature flags. Tools must check this field to ensure they support
18+
the corresponding version.
19+
1020
- `pip_version`: a string with the version of pip used to produce the report.
1121
- `install`: an object where the properties are the canonicalized names of the
1222
distribution packages (to be) installed and the values are of type
@@ -55,6 +65,7 @@ will produce an output similar to this (metadata abriged for brevity):
5565

5666
```json
5767
{
68+
"version": "0",
5869
"pip_version": "22.2",
5970
"install": {
6071
"pydantic": {

news/53.feature.rst

Lines changed: 3 additions & 3 deletions
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

Lines changed: 1 addition & 0 deletions
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)