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

Multiple constraints dependencies does not consider the python version #5858

Open
3 tasks done
zen-xu opened this issue Jun 16, 2022 · 1 comment
Open
3 tasks done
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged

Comments

@zen-xu
Copy link

zen-xu commented Jun 16, 2022

  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: macos
  • Poetry version: 1.1.13

Issue

I am developing a project which compacts with py2 and py3. But py3 depends on a package, which also depends on a package I need. So I use multiple constraints dependencies to specify this package. But poetry will solve failed.

This is a little confusing, let me show you an example.

Here is my external package dependency

[tool.poetry]
name = "module_a"
version = "0.1.0"
description = ""

[tool.poetry.dependencies]
python = "^3.7"
requests = "^2.0"

[tool.poetry.dev-dependencies]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

Here is my project dependency

[tool.poetry]
name = "my_project"
version = "0.1.0"
description = ""

[tool.poetry.dependencies]
python = "^2.7 | ^3.7"
requests = [
  {version = "^1.0", python="^2.7"},
  {version = "^2.0", python="^3.7"}
]
module_a = { path = "../module_a", python="^3.7" }

[tool.poetry.dev-dependencies]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

So dependencies of my_project should be like

py2:
  requests: ^1.0
py3:
  requests: ^2.0
  module_a:
    requests: ^2.0

However, poetry thinks requests should depend on ^1.0, even though I have specified py2 use ^1.0 and py3 use ^2.0

@zen-xu zen-xu added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Jun 16, 2022
@dimbleby
Copy link
Contributor

pretty sure this is going to be a duplicate of #5506, certainly it looks similar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants