Skip to content

Commit 60c2d30

Browse files
committed
install_report: add pip_version
1 parent 360e1d8 commit 60c2d30

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

docs/html/reference/installation-report.md

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ 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+
- `pip_version`: a string with the version of pip used to produce the report.
1011
- `install`: an object where the properties are the canonicalized names of the
1112
distribution packages (to be) installed and the values are of type
1213
`InstallationReportItem` (see below).
@@ -51,6 +52,7 @@ will produce an output similar to this (metadata abriged for clarity):
5152

5253
```json
5354
{
55+
"pip_version": "22.2",
5456
"install": {
5557
"pydantic": {
5658
"download_info": {

src/pip/_internal/models/installation_report.py

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from pip._vendor.packaging.markers import default_environment
44
from pip._vendor.packaging.utils import canonicalize_name
55

6+
from pip import __version__
67
from pip._internal.req.req_install import InstallRequirement
78

89

@@ -38,6 +39,7 @@ def _install_req_to_dict(cls, ireq: InstallRequirement) -> Dict[str, Any]:
3839

3940
def to_dict(self) -> Dict[str, Any]:
4041
return {
42+
"pip_version": __version__,
4143
"install": {
4244
canonicalize_name(ireq.metadata["Name"]): self._install_req_to_dict(
4345
ireq

0 commit comments

Comments
 (0)