You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
When using poetry update to resolve dependencies, Poetry treats dependencies without extras as distinct entities, leading to unexpected behavior. This issue can be illustrated as follows:
In repo-a's pyproject.toml, the definition for the source of private-package-a[extra-a] is set to "source-a".
repo A has a dependency on pivate-pacakge-b, and pivate-pacakge-b in turn depends on private-package-a (without extra).
However, repo-a's pyproject.toml does not define the source for private-package-a without any extras.
The problem arises when Poetry encounters this configuration. It raises an error: "Package private-package-a (*) not found." The issue here is that package source keys are not inherited by their dependencies when extras are involved, which is unexpected behavior.
repo-a's pyproject.toml
[tool.poetry]
name = "repo-a"
version = "0.0.0"
description = ""
[tool.poetry.dependencies]
private-package-a = { version = "*", source = "source-a", extras = ["extra-a"] }
private-package-b = { version = "*", source = "source-a" }
[[tool.poetry.source]]
name = "source-a"
priority = "explicit"
private-package-b's pyproject.toml
[tool.poetry]
name = "private-package-b"
version = "0.0.0"
description = ""
[tool.poetry.dependencies]
private-package-a = { version = "*", source = "source-a" }
[[tool.poetry.source]]
name = "source-a"
priority = "explicit"
Expected Behavior:
Is it considered valid in Poetry to define a package with multiple sources (if they have different extras)? If not, implementing a validation check could be beneficial.
Temporary Workaround:
To work around this issue, you can temporarily declare the source for the dependency without extras in another group to avoid encountering the error.
[tool.poetry]
name = "repo-a"
version = "0.0.0"
description = ""
[tool.poetry.dependencies]
private-package-a = { version = "*", source = "source-a", extras = ["extra-a"] }
private-package-b = { version = "*", source = "source-a" }
[tool.poetry.group.service.dependencies]
private-package-a = { version = "*", source = "source-a" } # add this line
[[tool.poetry.source]]
name = "source-a"
priority = "explicit"
The text was updated successfully, but these errors were encountered:
-vvv
option) and have included the output below.Issue
When using
poetry update
to resolve dependencies, Poetry treats dependencies without extras as distinct entities, leading to unexpected behavior. This issue can be illustrated as follows:The problem arises when Poetry encounters this configuration. It raises an error: "Package private-package-a (*) not found." The issue here is that package source keys are not inherited by their dependencies when extras are involved, which is unexpected behavior.
repo-a's pyproject.toml
private-package-b's pyproject.toml
Expected Behavior:
Temporary Workaround:
To work around this issue, you can temporarily declare the source for the dependency without extras in another group to avoid encountering the error.
The text was updated successfully, but these errors were encountered: