-
from pkg_resources import working_set, get_distribution, VersionConflict, DistributionNotFound, DistInfoDistribution
for dist in working_set:
dist: DistInfoDistribution
dist.requires() I can get requirements with method requires. for dist in working_set:
dist: DistInfoDistribution
extras: list[str] = dist.extras |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
If you use Also please note that |
Beta Was this translation helpful? Give feedback.
-
I found out something interesting. |
Beta Was this translation helpful? Give feedback.
-
Whoila! |
Beta Was this translation helpful? Give feedback.
Whoila!
working_set.by_key['jsonschema'].requires(('format',))
returns[Requirement.parse('attrs>=22.2.0'), Requirement.parse('jsonschema-specifications>=2023.03.6'), Requirement.parse('referencing>=0.28.4'), Requirement.parse('rpds-py>=0.7.1'), Requirement.parse('fqdn; extra == "format"'), Requirement.parse('idna; extra == "format"'), Requirement.parse('isoduration; extra == "format"'), Requirement.parse('jsonpointer>1.13; extra == "format"'), Requirement.parse('rfc3339-validator; extra == "format"'), Requirement.parse('rfc3987; extra == "format"'), Requirement.parse('uri-template; extra == "format"'), Requirement.parse('webcolors>=1.11; extra == "format"')]