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 Groups as 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.

Feature Request

There seems to be a few places where this issue is mentioned, but I don’t see anything explicitly tracking it.

(Specifically @matthijskooijman’s comment (point 2) 1644#issuecomment-895848818)

The new groups functionality is very helpful when managing packages installed while developing a project, but seems to miss a pretty good use case - basically using groups in place of extras when installing this package in another environment.

Instead of having to do:

# myproject_1

[tool.poetry.dependencies]
package_1 = "^0.0.1"

[tool.poetry.group.group_a]
optional = true

# this lets someone else develop this project with optional deps
[tool.poetry.group.group_a.dependencies]
package_2 = {version = "^0.0.2", optional = true}
package_3 = {version = "^0.0.3", optional = true}

# need to explicitly define "extras" for other packages install optional deps
[tool.poetry.extras]
group_a = ["package_2", "package_3"]

It would be cleaner (and make more sense I think, once groups is out of preview), if we could just do:

# myproject_1

[tool.poetry.dependencies]
package_1 = "^0.0.1"

[tool.poetry.group.group_a]
optional = true

[tool.poetry.group.group_a.dependencies]
package_2 = "^0.0.2"
package_3 = "^0.0.3"

# didn't need to explicitly define "extras", or individual packages as "optional"

And then in myproject_2:

# myproject_2

[tool.poetry.dependencies]
myproject_1 = {version = "^1.0.0", extras = ["group_a"]}

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:20
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
rino0601commented, Dec 7, 2022

Let say I want to pip install myproject_1[group_a] For now, it seems I have to write it this way:

# myproject_1
[tool.poetry.dependencies]
package_1 = "^0.0.1"

# annoying repetition 1
package_2 = {version = "^0.0.2", optional = true}
package_3 = {version = "^0.0.3", optional = true}

[tool.poetry.group.group_a]
optional = true

[tool.poetry.group.group_a.dependencies]
package_2 = "^0.0.2"
package_3 = "^0.0.3"

# need to explicitly define "extras" for other packages install optional deps
[tool.poetry.extras]
group_a = ["package_2", "package_3"] # annoying repetition 2

It would be nice if I could write it concisely like:

# myproject_1
[tool.poetry.dependencies]
package_1 = "^0.0.1"

[tool.poetry.group.group_a]
optional = true
extra = true    # just 1 flag to avoid repetition
[tool.poetry.group.group_a.dependencies]
package_2 = "^0.0.2"
package_3 = "^0.0.3"

There will be many cases in which you want to verify dependencies expressed in extras during development, so in many cases extras will soon become groups. Therefore, it would be very useful if we could express it as above.

1reaction
neersightedcommented, Nov 30, 2022

Optional dependencies outside the main group are meaningless in terms of extras. Move it to main and things will work as you expect.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BuddyPress Groups Extras] Support - WordPress.org
BP Group Extra not showing on group menu. Started by: thbob ... How to edit group fields visibility for all groups ... Ongoing...
Read more >
Section 2. Creating and Facilitating Peer Support Groups
Learn how to bring together and facilitate support and encouragement among a group of people who share common problems and experiences.
Read more >
What's the difference between extras and groups in poetry?
'group' is designed for internal developer, it applies for both package and application development. However, 'extra' is designed for external ...
Read more >
7 Best Anxiety Support Groups of 2022 - Healthline
A quick look at the best anxiety support groups of 2021 · Best overall: Support Groups Central · Best online discussion forum: Anxiety...
Read more >
Support groups - Better Health Channel
There are lots of support groups in Australia. Many have regular meetings held in places like healthcare services, community centres, local halls or...
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