1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

Add requested_extras to installation report

This commit is contained in:
Stéphane Bidoul 2022-06-04 12:56:38 +02:00
parent d6685d09cf
commit 2c84a1c16d
No known key found for this signature in database
GPG key ID: BCAB2555446B5B92
2 changed files with 4 additions and 0 deletions

View file

@ -30,6 +30,9 @@ class InstallationReport:
# https://www.python.org/dev/peps/pep-0566/#json-compatible-metadata
"metadata": ireq.get_dist().metadata_dict,
}
if ireq.user_supplied and ireq.extras:
# For top level requirements, the list of requested extras, if any.
res["requested_extras"] = list(sorted(ireq.extras))
return res
def to_dict(self) -> Dict[str, Any]:

View file

@ -85,6 +85,7 @@ def test_install_report_index(script: PipTestEnvironment, tmp_path: Path) -> Non
paste_report["download_info"]["archive_info"]["hash"]
== "sha256=11645842ba8ec986ae8cfbe4c6cacff5c35f0f4527abf4f5581ae8b4ad49c0b6"
)
assert paste_report["requested_extras"] == ["openid"]
assert "requires_dist" in paste_report["metadata"]