Add check of PyPi extras
See this GitHub thread and this pull request:
pip inspect | jq '.installed[]|select(.metadata.name=="molecule-plugins").metadata.provides_extra'
WARNING: pip inspect is currently an experimental command. The output format may change in a future release without prior warning.
WARNING: Ignoring invalid distribution -mltodict (/usr/local/lib/python3.10/dist-packages)
[
"azure",
"docker",
"ec2",
"gce",
"podman",
"test"
]
This is only available for pip
version >= 22.2
, a check that the provided extras
list matches the installed extras
could be added and a forcereinstall
could be automatically done if they don't.
Note that the above result followed the running this role with these defaults:
- name: "molecule-plugins"
extras:
- containers
- docker
state: forcereinstall
url: https://pypi.org/pypi/molecule-plugins
version: "23.0.0"
So it appears that all the extras are installed even when only some are listed?