-
Notifications
You must be signed in to change notification settings - Fork 955
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
Support URL requirements in transitive dependencies #1808
Comments
Same error on |
Note that this problem also affects One of our transitive dependencies is defined as Please, consider maintaining this behavior opt-in but having a flag to opt-out of it, otherwise this will be a complete stopper for some use cases. |
This is also going to be a blocker for a lot of people/teams. If there was a way to disable this check, and perhaps others that pip just deals with, that would be a huge plus for bringing this into more teams. |
I'm seeing this with transitive editable dependencies
|
Are transitive editable dependencies possible? How are your dependencies defined? |
Hi @charliermarsh thanks for the response. We're currently using poetry with editable dependencies for our monorepo eg
Since any package can have dependencies on others we can have lib1 in this example having dependencies on lib2. I understand that uv doesn't support poetry dependencies (yet), but we're able to What I'm noticing is that if I |
The next version of uv will support transitive URL dependencies. |
## Summary This PR would enable us to support transitive URL requirements. The key idea is to leverage the fact that... - URL requirements can only come from URL requirements. - URL requirements identify a _specific_ version, and so don't require backtracking. Prior to running the "real" resolver, we recursively resolve any URL requirements, and collect all the known URLs upfront, then pass those to the resolver as "lookahead" requirements. This means the resolver knows upfront that if a given package is included, it _must_ use the provided URL. Closes #1808.
Is this still an issue on
|
I'm seeing this as well with the latest
|
We don't support registry requirements that themselves depend on URL requirements. |
First of all, thanks a lot for all the great work you put into uv and ruff! Really appreciating how you improve developer experience in the python ecosystem. Now to my question: is it intended to support URL requirements in transitive dependencies at some point in the future? In my example, I have a dummy python package named [tool.poetry.dependencies]
pywrangler = { tag = "v0.1.1", git = "https://github.com/mansenfranzen/pywrangler.git" } When I install foo's wheel from a private index via
To be honest, I'm bit confused about what is currently supported or not. The documentation makes clear that transitive URL deps aren't supported while @charliermarsh comments from April 1st mention otherwise. |
My team is facing same issue. Is there any update on that? |
I am also confused by the documentation for transitive dependencies. The docs say:
I interpreted this to mean that it is possible to install a package that has a dependency with a URL dependency (e.g. trying to install |
URL dependencies of URL dependencies are supported! But the following are not:
The second is very rare but it's mentioned in the docs because it is possible for us to miss transitive URL dependencies if you provide the originating URL via a constraint or override. The documentation is intentionally nuanced for this reason but I can make it clearer. |
Created an issue to track that at: #8080 |
@charliermarsh Thanks a lot for clarifying! I'm struggling to understand the reasoning behind forbidding transitive URL dependencies for registry dependencies. Unfortunately, I couldn't find any documentation in related issues or docs regarding this conceptual design. Do you happen to have some further information on this? |
The most succinct explanation I can give is that we need to know the set of URLs upfront in order to fit them into the design of the resolver algorithm. So we recursively traverse any direct URL dependencies, resolving their own direct URL dependencies, etc. We can't do the same for registry dependencies, since we can't know what versions will be selected upfront and from which registry (unlike direct URLs, which tell us exactly where to find them). |
I think we're relatively unlikely to support it. Are you depending on that behavior? |
Thanks for your explanation. The rationale around the resolver algorithm helps me to get an intuition. I don't strictly depend on this feature. We have a "good-enough-workaround" to convert the URL dependency into a proper registry dependency. |
Thanks @charliermarsh, this is more clear than the (current) documentation and a helpful clarification (and does describe the situation I'm facing)!
@mansenfranzen does your workaround cover the case of URL dependencies in a registry package? I'm not sure there is any way to handle this with |
First of all, thank you for this awesome tool, its potential is enormous. 😄
Platform: Ubuntu + MacOs
uv version: 0.1.6
I guess this issue is related with #1603, but wasn't resolved in v0.1.16.
The error occurs when trying to install a package that in turn has a dependency that is installed via URL
For example, If we have a requirement.txt like the following to install a requirement with a URL.
requirement.txt:
And the packageA also have a requirement to install another package (packageB) from URL.
pyproject.toml (from package A)
When I try to install it with my requirements.txt with uv (v0.1.16) i'm obtaining the following error:
Currently, it appears that
uv
is encountering difficulty resolving inherited dependencies (such as packageB) from URLs specified in the dependencies section of pyproject.toml for packageA. I've provided a reproducible example in the following repository: uv-playground.When packageB is included directly in the main requirement.txt,
uv
successfully resolves the dependency. However, I believeuv
should automatically resolve inherited dependencies from dependent packages, irrespective of whether they are specified by URL or not, similar to the behavior of pip.pip example:
This issue impacts the ease of managing dependencies and could streamline the workflow significantly if resolved. Thank you for your attention to this matter.
The text was updated successfully, but these errors were encountered: