question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Does pip support extras in extras_require?

See original GitHub issue

It looks like using extras in requirements used in extras_require is not supported. For instance having this in setup.py:

    extras_require={
      'testing': 'Kotti[testing]',
      'development': 'Kotti[development]',
    },

and running pip install -e .[testing] results in Kotti being installed but not any of Kotti’s requirements listed in testing extra. Setuptools’ documentation in section Declaring “Extras” (optional features with their own dependencies) mentions using extras in install_requires but does not mention using it in extras_requires.

I’m using current develop which includes fix from https://github.com/pypa/pip/pull/2785.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:3
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
c9scommented, Sep 7, 2017

Why is this not supported by python setup.py ?

2reactions
piotr-dobrogostcommented, Oct 1, 2015

Thank you for taking a look.

It seems that the difference is due to lack of install_requires=['wheel'] in your test (I did not include this as I didn’t think it might be related). After adding it the extras do not get installed.

I suspect the problem could be the same as in issue #3046

Read more comments on GitHub >

github_iconTop Results From Across the Web

Does pip handle extras_requires from setuptools/distribute ...
It appears that pip install .[develop] (without the -e ) does not work, and you need to use an editable installation if you...
Read more >
Adding a default extra_require environment - Packaging
We just need to allow users to create an environment called None. For now the following will fail: from setuptools import setup extras_require...
Read more >
A Better Practice for Managing Many extras_require ...
In this article, I introduce a simple yet effective solution to manage optional dependencies via extras_require in Python. This method is ...
Read more >
Recursive Optional Dependencies in Python - Hynek Schlawack
... optional dependencies that are needed for HTTP/2 support. You can specify more than one extra at once: pip install httpx[http2,cli] will ...
Read more >
extras-require - PyPI
extras_require can be installed from PyPI or Anaconda. To install with pip: $ python -m pip install extras_require. To install with conda:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found