Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflicting dependencies even if dependency group is not installed #6611

Closed
4 tasks done
Cito opened this issue Sep 23, 2022 · 5 comments
Closed
4 tasks done

Conflicting dependencies even if dependency group is not installed #6611

Cito opened this issue Sep 23, 2022 · 5 comments
Labels
kind/question User questions (candidates for conversion to discussion) status/duplicate Duplicate issues

Comments

@Cito
Copy link

Cito commented Sep 23, 2022

  • Poetry version: 1.2.1
  • Python version: 3.9.13
  • OS version and name: Windows 10
  • pyproject.toml:
[tool.poetry.group.lint]
optional = true

[tool.poetry.group.lint.dependencies]
flake8 = "^5.0"

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

[tool.poetry.group.doc.dependencies]
sphinx = "^5.1"
  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

Since the current versions of Flake8 and Sphinx have conflicting dependencies, I have put these into separate, optional dependency groups. But no matter how I install (without one of the dependency groups or without both of them, running a simpe poetry install), I still get the error message because my-project depends on both flake8 (^5.0) and sphinx (^5.1), version solving failed. Shouldn't the optional dependency groups avoid such kinds of problems?

In the debug log I see

  1: fact: my-project depends on flake8 (^5.0)        
  1: fact: my-project depends on sphinx (^5.1)        

So it seems Poetry thinks that my project depends on both flake8 and sphinx, but it only optionally depends on them, and it should only give an error if both groups are installed at the same time, i.e. with lint,doc.

@Cito Cito added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Sep 23, 2022
@neersighted neersighted added kind/question User questions (candidates for conversion to discussion) status/duplicate Duplicate issues and removed kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Sep 23, 2022
@neersighted
Copy link
Member

Poetry's current resolver module ensures that every possible combination of dependencies, extras, and groups is installable. This is a key feature of Poetry, and while we have discussed future support for mutually exclusive groups or extras, such support would require a major refactor and (likely breaking) changes, and no one has seriously expressed interest in implementing similar.

Partially a dupe of #6419 as the same refactoring of the resolver is required, even if extras and dependencies are not the same.

@neersighted neersighted closed this as not planned Won't fix, can't repro, duplicate, stale Sep 23, 2022
@Cito
Copy link
Author

Cito commented Sep 23, 2022

Thanks for the quick answer @neersighted. I really had hoped this issue could be solved with dependency groups. Would be glad if this will eventually be implemented. If anybody has found a good alternative solution or workaround (extras seem to have the same problem as far as I understand), please let me know.

@neersighted
Copy link
Member

neersighted commented Sep 23, 2022

We are looking to add a new type of dependency management for 'non-importable' dependencies that keeps tools in their own venvs and doesn't force them to be part of the dependency tree. Very early days, but it will solve this in the long run for you.

I forget where the draft PR/work was parked -- @abn could you link your work?

@uvashisth
Copy link

Hi,
We are using Poetry and it has been really good so far. Recently we have come across this exact issue. I'm wondering if there are still plans to support this feature.

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/question User questions (candidates for conversion to discussion) status/duplicate Duplicate issues
Projects
None yet
Development

No branches or pull requests

3 participants