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 installing a Poetry dependency group

See original GitHub issue

Poetry 1.2 will be adding added support for dependency groups. It would be ergonomic if you could install a dependency group (as a whole) into a nox session.

Consider a Poetry group:

[tool.poetry.group.lint.dependencies]
flake8 = "*"
flake8-bugbear = "*"
flake8-broken-line = "*"
flake8-comprehensions = "*"
pep8-names = "*"

The cooresponding nox session could be simplified to:

def test(session: nox_poetry.Session):
    session.poetry.install_group("lint")
    ...

This avoids the DRY problem of listing all of the lint dependencies twice, once in a Poetry group and again in a nox session.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:5
  • Comments:7

github_iconTop GitHub Comments

2reactions
johnthagencommented, Sep 18, 2022

poetry export supports --only

poetry export --help

Description:
  Exports the lock file to alternative formats.

Usage:
  export [options]

...

--only=ONLY         The only dependency groups to include. (multiple values allowed)

So I think this would be a relatively easy way to get a requirements.txt file out for a specific group.

1reaction
thedrowcommented, Sep 4, 2022

@edgarrmondragon Go ahead 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Managing dependencies | master | Documentation - Poetry
Poetry provides a way to organize your dependencies by groups. For instance, you might have dependencies that are only needed to test your...
Read more >
What's the difference between extras and groups in poetry?
Dependency groups in Poetry gives you the ability to put dependencies together you might only need in certain stages during development ...
Read more >
Dependency Management With Python Poetry
After an update, a package might not work as it did before the update. A dependency manager like Python Poetry helps you specify,...
Read more >
How To Install Poetry to Manage Python Dependencies on ...
Poetry is a dependency manager for Python that is also capable of building and packaging your Python projects for distribution. As a dependency...
Read more >
Specify docs dependency groups with Poetry and Read the ...
Poetry 1.2 introduced a new feature which I have been waiting for a while: dependency groups. Until recently, the only groups were the...
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