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

uv picks old versions when using unbound dependencies #8813

Closed
olzhasar-reef opened this issue Nov 4, 2024 · 1 comment
Closed

uv picks old versions when using unbound dependencies #8813

olzhasar-reef opened this issue Nov 4, 2024 · 1 comment
Labels
duplicate This issue or pull request already exists question Asking for clarification or support

Comments

@olzhasar-reef
Copy link

We are currently migrating our projects to uv from pdm and we are facing weird version resolution issues when specifying dependencies without lower bounds.
Consider the following minimal pyproject.toml:

[project]
name = "example"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
    "django-stubs[compatible-mypy]",
    "djangorestframework-stubs[compatible-mypy]",
]
uv lock

This produces a lock file with the djangorestframework-stubs version 1.4.0, whereas the latest version is 3.15.1.


[[package]]
name = "djangorestframework-stubs"
version = "1.4.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
    { name = "coreapi" },
    { name = "django-stubs" },
    { name = "mypy" },
    { name = "requests" },
    { name = "typing-extensions" },
]
sdist = { url = "https://files.pythonhosted.org/packages/ff/b8/1c9cb32a9dcd3eb3f11cbb97465ad4bab17e8a54ebb3435661574d868908/djangorestframework-stubs-1.4.0.tar.gz", hash = "sha256:037f0582b1e6c79366b6a839da861474d59210c4bfa1d36291545cb6ede6a0da", size = 31984 }
wheels = [
    { url = "https://files.pythonhosted.org/packages/c6/e5/814c1819452746193b99acb97c8b5205d8fe7b01f11957376b9448794ca0/djangorestframework_stubs-1.4.0-py3-none-any.whl", hash = "sha256:f6ed5fb19c12aa752288ddc6ad28d4ca7c81681ca7f28a19aba9064b2a69489c", size = 51155 },
]

Interestingly, if we set the lower boundary the resolution works fine without any conflicts and the new version is being picked:

[project]
name = "example"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
   "django-stubs[compatible-mypy]",
   "djangorestframework-stubs[compatible-mypy]>=3",
]
[[package]]
name = "djangorestframework-stubs"
version = "3.15.1"
source = { registry = "https://pypi.org/simple" }
dependencies = [
    { name = "django-stubs" },
    { name = "requests" },
    { name = "types-pyyaml" },
    { name = "types-requests" },
    { name = "typing-extensions" },
]
sdist = { url = "https://files.pythonhosted.org/packages/f3/00/40ee7702b69d32bd88240468a7cdc4b52aca42e14513d04ec8e16b5c1c59/djangorestframework_stubs-3.15.1.tar.gz", hash = "sha256:34539871895d66d382b6ae3655d9f95c1de7733cf50bc29097638d367ed3117d", size = 35195 }
wheels = [
    { url = "https://files.pythonhosted.org/packages/a4/f4/463fe341a7fe4b79da9fef65327b8e8d696639eba592f9fced6b6b8593ff/djangorestframework_stubs-3.15.1-py3-none-any.whl", hash = "sha256:79dc9018f5d5fa420f9981eec9f1e820ecbd04719791f144419cdc6c5b8e29bd", size = 54399 },
]
uv version
uv 0.4.29 (85f9a0d0e 2024-10-30)

MacOS

@zanieb
Copy link
Member

zanieb commented Nov 4, 2024

Hi! I presume this is a case of #8157 in which the resolver could be using better heuristics.

@zanieb zanieb added duplicate This issue or pull request already exists question Asking for clarification or support labels Nov 4, 2024
@charliermarsh charliermarsh closed this as not planned Won't fix, can't repro, duplicate, stale Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists question Asking for clarification or support
Projects
None yet
Development

No branches or pull requests

3 participants