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

poetry selects wrong python version when markers present #4959

Closed
3 tasks done
maciejskorski opened this issue Dec 31, 2021 · 3 comments · Fixed by python-poetry/poetry-core#324
Closed
3 tasks done
Labels
kind/bug Something isn't working as expected

Comments

@maciejskorski
Copy link

maciejskorski commented Dec 31, 2021

  • 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: linux + Python 3.8.10
  • Poetry version: 1.2.0a2 (recent master)

Issue

Multiple constraints on python version fail when combined with valid markers.

This does work fine

# selecting 1.3.1 matching the system
[tool.poetry.dependencies]
python = "~3.8"
pandas = [
    {version="1.3.2",python='~3.9'},
    {version="1.3.1",python='~3.8'},
]

but not this

# selecting incompatible 1.3.2 and ignoring 1.3.1 - error
[tool.poetry.dependencies]
python = "~3.8"
pandas = [
    {version="1.3.2",python='~3.9',markers="sys_platform=='linux'"},
    {version="1.3.1",python='~3.8'},
]

when I move everything to markers it works fine again

# selecting 1.3.1 - fine!
[tool.poetry.dependencies]
python = "~3.8"
pandas = [
    {version="1.3.2",markers="python_version=='3.9' and sys_platform=='linux'"},
    {version="1.3.1",markers="python_version=='3.8'"},
]
@radoering
Copy link
Member

Probably duplicate of #3444

@maciejskorski
Copy link
Author

maciejskorski commented Jan 1, 2022

Related to #3444 but highlights bit different issues. From the logs it seems poetry doesn't merge package requirements.

  • Installing pandas (1.3.1)
  • Installing pandas (1.3.2)

UPDATE: the precise root-cause for both is clarified in #4965

Copy link

github-actions bot commented Mar 1, 2024

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 Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
3 participants