-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
tool.uv.sources
should work for indirect dependencies
#9446
Comments
If you're going to define a source, you should just make it a direct dependency -- what's the issue with that? You're already encoding that your project depends on a certain package. |
If I'm using a package from a private index, and that package has further dependencies on said private index, I don't want to have to add all of these indirect dependencies to as direct dependencies. It is a bit weird, though, since my private direct dependencies need packages from PyPI apart from the private ones, so I guess how to deal with that is also a question. |
Sort of related #8148 (comment) |
Does it work if you make the private index first priority and pypi the second priority? For applying extra information to indirect dependencies, you can use constraints, though you may need #9455 for that first. |
Strong agree with this. I find it very unintuitive that The main problem is that it forces you to declare second-order-plus dependencies as More detailsI work in the context of a large monorepo, Dagster. We have ~100 python packages defined in the repo with various interdependencies. If I am setting up a new package that pulls in some of our integration libraries, it might look like this:
But remember that there are many interdependencies among packages. If a user were setting up But in many development contexts, we want to make sure our packages resolve internal dependencies (i.e. dependencies on other dagster packages) against the versions from the same monorepo commit. So we will tack a big list of uv sources onto
But, because
So now in a dev context we have to chase down 2nd-order-plus deps and have a different package metadata than a user would have because of details of package resolution tooling. |
Just adding my 2 cents here. I often have the following use-case: |
If this helps anyone, I found out that in most cases I can use dependency override for indirect dependencies. One downside with this approach is that I have to specify package extras for the indirect dependency. For example, let's say my project depends on the package [project]
name = "test-uv-override"
version = "0.1.0"
requires-python = ">=3.13"
dependencies = [
"direct",
]
[tool.uv]
override-dependencies = [
"indirect[extra]@file:///path/to/indirect",
] Of course this will not install |
Currently (version 0.5.4),
uv
ignorestool.uv.sources
if a package is not a direct dependency (i.e. listed in the project'spyproject.toml
). I thinktool.uv.sources
should apply for all dependencies.The text was updated successfully, but these errors were encountered: