-
Notifications
You must be signed in to change notification settings - Fork 988
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 locking: allow forking when respecting Python version? #5647
Comments
This looks similar to #4668. In general, we try to reduce the number of diverging packages in your resolution (more different behaviors, more versions to audit, large lockfile). If you know that you want to split, you can manually get two distinct resolutions with:
Does nox need to be installed into the project venv? If not, would having it as a separate tool work for you? It's mostly like |
|
Do you have other examples where this happens? Having specific problem cases is very helpful for choosing the right defaults in the resolver. |
Sure, In general, every dependency in https://github.com/pyca/cryptography/blob/main/ci-constraints-requirements.txt that has a Our overall use case is: We want to pin dependencies in CI for reproducibility. We also want to test against the newest versions (using dependabot). And we want to test on multiple python versions/environments. Our ideal behavior, therefore, would be a single lockfile that gets us the newest versions for each platform. |
I should have posted this before, but the trick with specifying the root dep 2x to force forking doesn't seem to work:
|
So, this actually is possible now with a PR I coincidentally merged tonight. It's not yet released though. You can add this to a environments = ["python_version >= '3.8'", "python_version < '3.8'"] Or you can put it in a [tool.uv]
environments = ["python_version >= '3.8'", "python_version < '3.8'"] Then uv will solve those two forks, in order. So you end up with:
|
(In general, we prioritize solves in an order that attempts to minimize the number of selected versions. We could actually consider adding different strategies for this... I could imagine a strategy where we attempt to select the most recent version for every fork, rather than trying to minimize the number of versions.) |
Oooh, I'll play with this in the next release! FWIW, I think our use case is kind of strange in the world of corporate development, but fairly normal in OSS. |
This is fixed in the next release without the need for |
Consider this command:
argcomplete
is pinned to version 3.1.2, because this is the newest version that supports Python 3.7. However, there are newer versions (3.4.0) available.It'd be helpful (though maybe difficult!) if it were possible for
--universal
to emit "forks" for Python version:The text was updated successfully, but these errors were encountered: