I know that I can specify optional dependencies in setup.py
via extras_require:
setup(
name="Foo",
extras_require={
'bar': ["barpy"],
}
)
Now, is there a way for a user to list the extras my package offers? How else would a user know that it might be cool to install the package via
pip3 install .[bar]
?
You can inspect a project's metadata with the new importlib_metadata:
>>> import importlib_metadata
>>> importlib_metadata.metadata('xonsh').get_all('Provides-Extra')
['linux', 'mac', 'proctitle', 'ptk', 'pygments', 'win']
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With