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 add is too strict resulting in no versions of 'package' match 'version' #8954

Closed
dvorst opened this issue Feb 7, 2024 · 4 comments
Closed
Labels
kind/bug Something isn't working as expected

Comments

@dvorst
Copy link

dvorst commented Feb 7, 2024

The Issue

When adding packageboto3 and s3fs poetry automatically uses the latest version for both. However it is 'fixated' on those latest versions making it too strict. Currently, the latest versions of boto3 and s3fs don't go well with another, and version 1.34.34 rather than 1.34.36 has to be used for boto3 in order to work with s3fs, a difference of two minor revisions/patches.

When running

poetry add --dry-run boto3 s3fs

One would assume that poetry installs boto3 and s3fs, no matter which version (though preferably the latest). However, as the output below shows, it tries to install (and only tries to install) the latest version, leading to a dependency conflict:

Using version ^1.34.36 for boto3
Using version ^2024.2.0 for s3fs

Updating dependencies
Resolving dependencies... (0.9s)

Because no versions of aiobotocore match >2.5.4,<2.6.0 || >2.6.0,<2.7.0 || >2.7.0,<2.8.0 || >2.8.0,<2.9.0 || >2.9.0,<2.9.1 || >2.9.1,<2.10.0 || >2.10.0,<2.11.0 || >2.11.0,<2.11.1 || >2.11.1,<2.11.2 || >2.11.2,<3.0.0
 and aiobotocore (2.5.4) depends on botocore (>=1.31.17,<1.31.18), aiobotocore (>=2.5.4,<2.6.0 || >2.6.0,<2.7.0 || >2.7.0,<2.8.0 || >2.8.0,<2.9.0 || >2.9.0,<2.9.1 || >2.9.1,<2.10.0 || >2.10.0,<2.11.0 || >2.11.0,<2.11.1 || >2.11.1,<2.11.2 || >2.11.2,<3.0.0) requires botocore (>=1.31.17,<1.31.18).
And because aiobotocore (2.6.0) depends on botocore (>=1.31.17,<1.31.18), aiobotocore (>=2.5.4,<2.7.0 || >2.7.0,<2.8.0 || >2.8.0,<2.9.0 || >2.9.0,<2.9.1 || >2.9.1,<2.10.0 || >2.10.0,<2.11.0 || >2.11.0,<2.11.1 || >2.11.1,<2.11.2 || >2.11.2,<3.0.0) requires botocore (>=1.31.17,<1.31.18).
And because aiobotocore (2.7.0) depends on botocore (>=1.31.16,<1.31.65)
 and aiobotocore (2.8.0) depends on botocore (>=1.32.4,<1.33.2), aiobotocore (>=2.5.4,<2.9.0 || >2.9.0,<2.9.1 || >2.9.1,<2.10.0 || >2.10.0,<2.11.0 || >2.11.0,<2.11.1 || >2.11.1,<2.11.2 || >2.11.2,<3.0.0) requires botocore (>=1.31.16,<1.31.65 || >=1.32.4,<1.33.2).
And because aiobotocore (2.9.0) depends on botocore (>=1.33.2,<1.33.14)
 and aiobotocore (2.9.1) depends on botocore (>=1.33.2,<1.33.14), aiobotocore (>=2.5.4,<2.10.0 || >2.10.0,<2.11.0 || >2.11.0,<2.11.1 || >2.11.1,<2.11.2 || >2.11.2,<3.0.0) requires botocore (>=1.31.16,<1.31.65 || >=1.32.4,<1.33.14).
And because aiobotocore (2.10.0) depends on botocore (>=1.33.2,<1.34.23)
 and aiobotocore (2.11.0) depends on botocore (>=1.33.2,<1.34.23), aiobotocore (>=2.5.4,<2.11.1 || >2.11.1,<2.11.2 || >2.11.2,<3.0.0) requires botocore (>=1.31.16,<1.31.65 || >=1.32.4,<1.34.23).
And because aiobotocore (2.11.1) depends on botocore (>=1.33.2,<1.34.28)
 and aiobotocore (2.11.2) depends on botocore (>=1.33.2,<1.34.35), aiobotocore (>=2.5.4,<3.0.0) requires botocore (>=1.31.16,<1.31.65 || >=1.32.4,<1.34.35).
Because no versions of s3fs match >2024.2.0,<2025.0.0
 and s3fs (2024.2.0) depends on aiobotocore (>=2.5.4,<3.0.0), s3fs (>=2024.2.0,<2025.0.0) requires aiobotocore (>=2.5.4,<3.0.0).
Thus, s3fs (>=2024.2.0,<2025.0.0) requires botocore (>=1.31.16,<1.31.65 || >=1.32.4,<1.34.35).
And because boto3 (1.34.36) depends on botocore (>=1.34.36,<1.35.0)
 and no versions of boto3 match >1.34.36,<2.0.0, s3fs (>=2024.2.0,<2025.0.0) is incompatible with boto3 (>=1.34.36,<2.0.0).
So, because poetry-bug-report depends on both boto3 (^1.34.36) and s3fs (^2024.2.0), version solving failed.

When, on the other hand, the command below is run, which specifies the major and minor version but not the patch/revision

poetry add --dry-run boto3@^1.34.0 s3fs@^2024.0.0

Then the installation succeeds.

Updating dependencies
Resolving dependencies... (0.5s)

Package operations: 19 installs, 0 updates, 0 removals

  • Installing frozenlist (1.4.1)
  • Installing idna (3.6)
  • Installing multidict (6.0.5)
  • Installing six (1.16.0)
  • Installing aiosignal (1.3.1)
  • Installing attrs (23.2.0)
  • Installing jmespath (1.0.1)
  • Installing python-dateutil (2.8.2)
  • Installing urllib3 (2.0.7)
  • Installing yarl (1.9.4)
  • Installing aiohttp (3.9.3)
  • Installing aioitertools (0.11.0)
  • Installing botocore (1.34.34)
  • Installing wrapt (1.16.0)
  • Installing aiobotocore (2.11.2)
  • Installing fsspec (2024.2.0)
  • Installing s3transfer (0.10.0)
  • Installing boto3 (1.34.34)
  • Installing s3fs (2024.2.0)

Why this is a problem

when poetry add boto3 s3fs a user just wants to install these packages, it is rarely the case the user wants and only wants, the very latest package, because if so, the user would specify it. Having to specify poetry add boto3@^1.34.0 s3fs@^2024.0.0 in order for this to work, means the user must look up the current major and minor revision for each package in order for it to work, which is cumbersome, and most would expect this to be the default behavior.

poetry debug info

Poetry
Version: 1.7.1
Python:  3.12.1

Virtualenv
Python:         3.12.1
Implementation: CPython
Path:           /Users/dennis.van.de.vorst/Documents/projects/poetr-bug/.venv
Executable:     /Users/dennis.van.de.vorst/Documents/projects/poetr-bug/.venv/bin/python
Valid:          True

System
Platform:   darwin
OS:         posix
Python:     3.12.1
Path:       /opt/homebrew/opt/python@3.12/Frameworks/Python.framework/Versions/3.12
Executable: /opt/homebrew/opt/python@3.12/Frameworks/Python.framework/Versions/3.12/bin/python3.12

pyproject.toml

[tool.poetry]
name = "poetry-bug-report"
version = "0.1.0"
description = ""
authors = ["dvorst <87502756+dvorst@users.noreply.github.com>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.12"

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

System info

MacBook Pro 2022
Apple silicon M2 processor
macOs 14.2

@dvorst dvorst added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Feb 7, 2024
@dvorst dvorst changed the title poetry add results in "no versions of 'package match version' poetry add results in "no versions of 'package' match 'version' Feb 7, 2024
@dvorst dvorst changed the title poetry add results in "no versions of 'package' match 'version' poetry add is too strict resulting in no versions of 'package' match 'version' Feb 7, 2024
@dimbleby
Copy link
Contributor

dimbleby commented Feb 7, 2024

You forgot to say what you did, what happened, what you expected to happen.

Also please check for duplicates

@dvorst
Copy link
Author

dvorst commented Feb 7, 2024

Sorry @dimbleby, I hit enter when entering the title which submitted the issue, and I had to go into a meeting afterwards, it should be complete now.

@dimbleby
Copy link
Contributor

dimbleby commented Feb 7, 2024

duplicate #707 please close

@dvorst dvorst closed this as not planned Won't fix, can't repro, duplicate, stale Feb 7, 2024
@abn abn removed the status/triage This issue needs to be triaged label Mar 2, 2024
Copy link

github-actions bot commented Apr 3, 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 Apr 3, 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
Development

No branches or pull requests

3 participants