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.

Support extras that reference other extras

See original GitHub issue

I want to do something like this (simplified for the example):

setup(
    name='my-project',
    extras_require={
        'tester': [
            "pytest==3.3.2",
        ],
        'dev': [
            "pytest-xdist",
            ".[tester]",
        ],
    },
    ...
)

When I run pip install -e .[dev], I want it to install pytest and xdist. Right now, it fails saying that I supplied an invalid package name.

Also of interest is that the following incantation spits no error, but seems to ignore the tester extra:

        'dev': [
            "pytest-xdist",
            "my-project[tester]",
        ],

I’m open to attempting at a PR, but was curious if someone had a reason that I shouldn’t even attempt this.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:18 (10 by maintainers)

github_iconTop GitHub Comments

8reactions
benoit-pierrecommented, Nov 13, 2018

@skirpichev: actually, you can rely on the fact that interpolation is enabled:

[options.extras_require]
tester =
    pytest==3.3.2
    pytest-sugar
dev =
    pytest-xdist
    %(tester)s
2reactions
benoit-pierrecommented, Nov 13, 2018

It was considered a bug, introduced with Python 3, but it was found that the behaviour has been present all along (with Python 2 too), so disabling interpolation would be a backward incompatible change. Allowing the use case above is a good argument for keeping it, so maybe we should just make it official (mention it in the documentation, and add a test for it). @jaraco, @pganssle: thoughts?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reference for package extras - Apache Airflow
These are extras that add dependencies needed for integration with other software packages installed usually as part of the deployment of Airflow. extra....
Read more >
Understanding the Extras Section of the Question Editor
The Extras section allows you to add more information about the question - information that we refer to as metadata. There are a...
Read more >
Adding Extras - ResRequest Support
Learn how to add and edit extras from a reservation. Add extras using the Extras quick entry and ... Add a 'Service by'...
Read more >
sdk/extras/android/support/design/res/values/attrs.xml
A reference to a TextAppearance style to be applied to tabs. --> ... set for any of the other flags to take effect....
Read more >
EndNote Extras - Library Subject Guides
EndNote 20.1 for MAC (supports M1) · EndNote X9 for Windows ... EndNote Extras. Merging Multiple Documents and Reference Lists.
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