-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
universal resolution occasionally doesn't work with no-build-package
when the package is a transient dependency of a dependency included in both dependency-groups
and build-system.requires
#10977
Comments
no-build-package
when the package is included in both dev dependencies and build-system.requires
no-build-package
when the package is included in both dependency-groups
and build-system.requires
no-build-package
when the package is included in both dependency-groups
and build-system.requires
no-build-package
when the package is a transient dependency of a dependency included in both dependency-groups
and build-system.requires
I can look. |
As you guessed it's hard to do much here, I can't reproduce :/ |
i will try playing around with this some more tomorrow. i'll close this for now and will re-open it if i can figure out a way to reliably reproduce it. either way thanks for looking into it |
Thanks. If you can figure out a reliable repro I'd love to fix it! |
My guess (?) is that it has something to do with |
Apologies for the more narrow comment here, but:
Have you tried doing something like this?
Sorry if I'm missing something here. And obviously the non-determinism you're seeing here isn't really addressed by this. |
yeah that's what i was doing originally but i learnt about |
i think i got it
|
Great, thank you! I'll try again. |
I think the issue is that |
) ## Summary This is a really subtle issue. I'm actually having trouble writing a test for it, though the problem makes sense. In short, we're sharing the `SharedState` between the `BuildContext` and the universal resolver. The `SharedState` includes `VersionMap`, which tracks incompatibilities... The incompatibilities use the platform tags, which are only present when resolving from the `BuildContext` (i.e., when resolving build dependencies). The universal resolver then fails because it sees a bunch of "incompatible" wheels that are incompatible with the current platform (i.e., the current Python interpreter). In short, we _cannot_ share a `SharedState` across two operations that perform a universal and then a platform-specific resolution. So this PR adds separate types and fixes up any overlapping usages. A better setup, for the future, would be to somehow share the underlying simple metadata, and only track separate `VersionMap` -- since there _is_ a bunch of data we can share. But that's a larger change. Closes #10977.
Summary
this issue seems to be similar to #9396 in that it seems to happen randomly and i can't reliably reproduce it, despite spending hours trying to come up with a minimal repro.
from my understanding of universal resolution, if i have a dependency on a package that does not have a single version that can be used for the entire supported
requires-python
range, multiple versions can be resolved to account for that. however if i try to use this functionality withno-build-package
, it seems to sometimes fail to resolve the package:here, i expect it to select
libcst==1.1.0
for python 3.8 andlibcst==1.6.0
for python >=3.9 because while 1.1.0 supports python 3.8-3.13, there's no wheels for 3.13 and 1.6.0 only supports python >=3.9. it sometimes works as i expect, since i can see this in the generated lockfile:but sometimes it fails to do this
steps to reproduce
uv sync --upgrade
output:
i realize this probably isn't really a helpful without a consistent repro, but this is the second issue i've run into where uv seems to change its behavior randomly when i haven't changed anything in my project. it's quite frustrating so i would like to try and get to the the bottom of what's causing these issues, so any advice on additional info i can provide / debugging steps would be appreciated. i've tried deleting my
.venv
, deletinguv.lock
and running uv with--no-cache
but it doesn't seem to have an impact. my current theory is that it might have something to do with the fact that i upgraded uv from 0.5.20 to 0.5.24, but i can't reliably reproduce it by repeating those steps either :(Platform
windows 10
Version
0.5.24
Python version
3.13
The text was updated successfully, but these errors were encountered: