Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip show doesn't handle extras (in the requirements or Required-By metadata) #3797

Open
anntzer opened this issue Jun 15, 2016 · 2 comments
Open
Labels
C: extras Handling optional dependencies C: list/show 'pip list' or 'pip show' state: blocked Can not be done until something else is done type: enhancement Improvements to functionality

Comments

@anntzer
Copy link
Contributor

anntzer commented Jun 15, 2016

  • Pip version: 8.1.2
  • Python version: 3.5.1
  • Operating System: Arch Linux

Description:

extras_requires cannot be displayed using pip show

What I've run:

Within a virtualenv:

$ pip --isolated install 'dask[bag]'
# dask itself has no deps; dask[bags] has a few, they get correctly installed
# <... elided>
$ pip show dask

---
Metadata-Version: 2.0
Name: dask
Version: 0.10.0
Summary: Minimal task scheduling abstraction
Home-page: http:/dask/dask/
Author: Matthew Rocklin
Author-email: [email protected]
License: BSD
Location: /tmp/foo/lib/python3.5/site-packages
Requires: 
Classifiers:
$ pip show 'dask[bag]'
# no output, exits with status 1

More generally, an query UI/API for extras would be nice (especially if it doesn't involve installation -- but that also applies to a query UI/API for dependencies).

@jaraco
Copy link
Member

jaraco commented Nov 1, 2018

In the meantime, you can output a list of extras with importlib_metadata:

>>> import importlib_metadata
>>> importlib_metadata.metadata('xonsh').get_all('Provides-Extra')
['linux', 'mac', 'proctitle', 'ptk', 'pygments', 'win']
>>> importlib_metadata.metadata('xonsh').get_all('Requires-Dist')
["distro; extra == 'linux'", "gnureadline; extra == 'mac'", "setproctitle; extra == 'proctitle'", "prompt-toolkit; extra == 'ptk'", "pygments (>=2.2); extra == 'pygments'", "win-unicode-console; extra == 'win'"]

@pradyunsg
Copy link
Member

@pradyunsg pradyunsg changed the title pip show doesn't handle extras_requires pip show doesn't handle extras (in the requirements or Required-By metadata) Jan 2, 2023
@ichard26 ichard26 added the state: blocked Can not be done until something else is done label Apr 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: extras Handling optional dependencies C: list/show 'pip list' or 'pip show' state: blocked Can not be done until something else is done type: enhancement Improvements to functionality
Projects
None yet
Development

No branches or pull requests

4 participants