Skip to content
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

Transitive index pinning using uv build / add #10410

Open
rivershah opened this issue Jan 8, 2025 · 0 comments
Open

Transitive index pinning using uv build / add #10410

rivershah opened this issue Jan 8, 2025 · 0 comments

Comments

@rivershah
Copy link

rivershah commented Jan 8, 2025

I'm using uv for package management with private, per-project, token-based indices hosted on gitlab. While I can pin direct dependencies to specific indexes in pyproject.toml, I need a way to ensure that all downstream consumers can also resolve pinned indices. Currently, one has to exhaustively list out transitive dependencies and pinned indices in downstream packages.

Could uv build be enhanced to retain pinned index information, so when a downstream consumer uses uv add, the pinned indices are correctly applied?

This is a departure from the python standard but could significantly enhance private index-based builds and installs, which need to rely on fully specified wheel paths or git tags.

Example Scenario:

  1. package_a has the following pyproject.toml:
dependencies = ["some_private_package"]

[tool.uv.sources]
some_private_package = { index = "some_private_package_private_index" }

[[tool.uv.index]]
name = "some_private_package_private_index"
url = "https://<token>@gitlab.example.com/api/v4/projects/123/packages/pypi"

package_b adds package_a as a dependency:

uv add package_a

package_b must manually specify the index for some_private_package and its transitive dependencies. Automating this process would streamline dependency management. wheel metadata discards all the pinned index information.

Is this functionality supported in uv build, or are there plans to add it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant