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 Poetry support recursive extras?

See original GitHub issue
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.

Issue

Does Poetry support recursive (for lack of a better term, it’s early) extras best exemplified by this pyproject.toml snippet?

[tool.poetry.dependencies]
attrs = "~19.3"
pandas = "~1.1"
# optional
quandl = { version = "~3.5.2", optional = true }
matplotlib = { version = "~3.3.0", optional = true }
networkx = { version = "~2.4.0", optional = true }
scikit-learn = { version = "~0.22.0", optional = true }

[tool.poetry.extras]
quandl = ["quandl"]
viz = ["matplotlib", "networkx"]
ml = ["viz", "scikit-learn"]
all = ["ml", "quandl"]

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
sinoroccommented, Nov 25, 2020

For comparison, this is how it can be done with setuptools setup.cfg: https://stackoverflow.com/a/61610341/

1reaction
sinoroccommented, Nov 17, 2020

Personally I am not convinced there is a need for such a feature with such a notation. Seems to be adding more confusion. You may want to give the UX a second look

See if it would make sense in the context of the dependencies groups feature (planned for v1.2).


If I were to change extras in order to avoid repetition for dependencies that are in multiple extras (in a way this is what you are trying to solve, right?), this is what I would aim for, but I think the dependencies groups feature already covers this (I have not read the full discussion on this, so I might be wrong):

libraryA = { "*", in_extras = [ "alpha", "bravo" ] }
ilbraryB = { "*", in_extras = [ "alpha" ] }
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use poetry for recursive installation? - Stack Overflow
poetry add <packagename> adds and installs a dependency available on pypi (or if configured other package repositories) to you project.
Read more >
Dependency Management With Python Poetry
Learn how Python Poetry will help you start new projects, maintain existing ones, and master dependency management.
Read more >
History | Poetry - Python dependency management and ...
Fixed recursion errors when retrieving extras (#2787). Fixed PyPI always being displayed when publishing even for custom repositories (#2905). Fixed handling of ...
Read more >
Recursive by Luisa A. Igloria - Poetry Foundation
Do not look for illumination. Mostly there is the twitch that precedes. gesture, the button's resistance. as you try to slide it into...
Read more >
Making Python Packages Part 2: How to Publish & Test Your ...
Poetry is a Python library that we can use to create a package, publish it to PyPI more easily, AND it will deal...
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