-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Dependency resolution: unclear behaviour of --only-group
#9211
Comments
|
Do you have an up-to-date |
I'll send the up-to-date lock file as soon as I can (in the subway right now ^^). I understand that locking locks the entire project. However, even if the dev group contains strictly nothing else than If there is a reason behind this behaviour, documenting it clearly might be helpful 🙏 |
Oh I see you're using
Nor if I try syncing first
|
I'm not quite sure what's going on, perhaps some verbose logs would be helpful. |
I am only having the issues with |
|
Do you have I am finishing the toy project to reproduce, I'll send it to you in a few minutes. |
Ah okay I can reproduce with that (I thought I had it, but must have messed up when creating the reproduction). And I can work around it by adding a constraint
or by disabling builds
|
Here is a toy project that reproduces the issue: The code is dummy, but the dependencies are exactly the same as my project. |
We include the numpy version as a preference
I believe we always use the lockfile versions as preferences during project resolution |
I sent my message at the same time 🙂 I did found some several workarounds indeed, including fixing the numpy version like you did 👍 However I would like to understand clearly why I end up with this behaviour in order to be able to setup my projects correctly. From my understanding of the documentation, my two commands should end up with the same environment but they do not at all. Maybe some change in the documentation of the I leave that to the Hope this may help you or somebody in the future encountering the same issue as me. |
And by the way, fixing But |
Basically this is caveated with: in all uv project operations, we'll prefer versions in the lockfile during resolution for consistency. I don't think this is well documented, we can improve that. Using |
Yes, this is what I'm starting to understand 👍 Thank you very much for the help and reactivity, this is much appreciated 🙏 |
I think the problem you're hitting is the following: uv tries to compute a uniersal lockfile for your The proper solution is #8686, as a workaround you can coerce uv to give you different numpy versions on different Python versions, something like the following, adjust the bounds to your liking:
|
Yes,
This is basically the solution I ended up with (in my dev dependencies) 😉 |
Hello,
I have an issue with dependency resolution.
My project is configured as follows (I am working on a custom
Pytoch Lightning
extension,tomli
is used only in unit tests):After locking the environment and building the wheel, the following line fails in my testing script (I want to run the unit tests on the built wheel, not on the source):
with the error (confidential data replaced by
XXX
)From what I understand from uv documentation
and given the fact that
tomli
has no dependency at all (which meansnumpy
is NOT in thedev
dependency group), the following command should behave exactly the same:However, this command runs perfectly!
I tried the
--refresh
and--reinstall
options in the first version, it does not work.=> Is this a bug or something I am missing?
If that is unclear I can try to reproduce my issue in a toy project
The text was updated successfully, but these errors were encountered: