-
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
Support git URLs in project.dependencies #7069
Comments
This is also relevant to:
I'd expect to see:
But instead I see:
|
You can pass |
Thanks, that's good to know. It's still kind of confusing that by default it puts it somewhere that's not going to be picked up by the hatchling build system when installed as a package by other package managers, even though it works perfectly well. Edit: I realise I'm assuming that the hatchling build tool doesn't know to check Poetry uses its own dependencies section, rather than the standard dependencies section too. uv uses hatchling as the build tool. Does hatchling know to install git dependencies from |
The thinking is that if you're using uv, you likely want to use the first-class uv features -- and also, that you already can't publish such packages to PyPI, so there's less benefit in encoding the standardized metadata. (Whereas, e.g., the But it's totally fine to use
It's a little nuanced but hatchling is a build backend, but what you're describing would arguably be the responsibility of a build frontend (the thing that prepares the environment and calls the build hooks). I guess it's somewhat debatable who is "responsible" for this part actually. But regardless, |
Thanks, on reflection, I think your last paragraph highlights my real concern. Suppose I create a private package in GitHub which depends on another private package in GitHub. With poetry, I can add the project_one as a dependency of project_two as follows:
This results in a ...
[tool.poetry.dependencies]
package_one = {git = "https://github.com/organisation/package-one-repository.git"}
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api" On the surface, this appears to be the same thing that However, the critical difference is that the
So, I can use My understanding is that if I built project_one and project_two with uv, and used the preferred
as the hatchling build backend doesn't know about Thinking about this, I retract my suggestion to include the git URLs in |
Yes what you've written there sounds correct. We have plans to build a backend, just uncertain on the timeline, ref #3957 |
I've summarised this discussion on #3957, so I'll close this issue. |
EDIT
Ignore the below. What I'm really asking for is a
uv
build backend. This will unlock the ability for private git packages to depend on other private git packages, and still be installed withpip
,pipx
,poetry
, etc, without needing the package end user to change their tools.END EDIT
Currently, if I try to add my private git repository as a dependency of another project,
uv
adds the repository to[tool.uv.sources]
.However, I can manually add the git dependency directly to
project.dependencies
, and it works OK:This should enable packages which depend on this package, and which are installed by something other than
uv
to correctly fetch the required dependencies.This syntax is supported by the underlying hatchling build system:
https://hatch.pypa.io/latest/config/dependency/#version-control-systems
Would it make more sense for
uv add package_name@git+https://github.com/organisation/package-repository.git
to just drop this package specifier directly intoproject.dependencies
, rather than putting it somewhere which won't get picked up by other tools trying to install the current package?The text was updated successfully, but these errors were encountered: