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:
parent
d6685d09cf
commit
2c84a1c16d
|
@ -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]:
|
||||
|
|
|
@ -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"]
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue