rules_pycross
rules_pycross copied to clipboard
Support for git source in uv
UV can specify that the package is coming from a git repository. It uses the shown syntax in the uv.lock file for that.
[[package]]
name = "some-package"
version = "0.0.1"
source = { git = "https://github.com/org/repo.git?rev=my-branch" }
This is the same thing as pip install some-package @ https://github.com/org/repo.git?rev=my-branch, which will install the wheel directly from github, without the need of cloning it. Since it is in pip I bet poetry and the likes also have this feature build in.
It would be super nice if this kind would be supported. Please keep up the awesome work!
PS: Downloading from a custom index is using that field, too. Is that supported? I couldn't find anything. Here is for example torch
[[package]]
name = "torch"
version = "2.5.0"
source = { registry = "https://download.pytorch.org/whl/test/cu124" }
resolution-markers = [
"platform_machine == 'aarch64' and sys_platform == 'linux'",
]
dependencies = [
{ name = "filelock", marker = "platform_machine == 'aarch64' and sys_platform == 'linux'" },
{ name = "fsspec", marker = "platform_machine == 'aarch64' and sys_platform == 'linux'" },
{ name = "jinja2", marker = "platform_machine == 'aarch64' and sys_platform == 'linux'" },
{ name = "networkx", marker = "platform_machine == 'aarch64' and sys_platform == 'linux'" },
{ name = "sympy", marker = "platform_machine == 'aarch64' and sys_platform == 'linux'" },
{ name = "typing-extensions", marker = "platform_machine == 'aarch64' and sys_platform == 'linux'" },
]
wheels = [
{ url = "https://download.pytorch.org/whl/test/cu124/torch-2.5.0-cp311-cp311-linux_aarch64.whl" },
]