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

[feature request] Support for explicit source/index specification on individual dependencies #6582

Closed
menzenski opened this issue Aug 24, 2024 · 3 comments

Comments

@menzenski
Copy link

menzenski commented Aug 24, 2024

We currently use a mix of pyenv, pipx, and Poetry in our Python projects and I'm very interested in uv's potential to replace all of these tools.

One of the things that we want to be able to do is to use the public PyPI index by default, but use our internal Artifactory index for specific organization-internal dependencies. We don't want to search the public PyPI index for those private dependencies in case there's a public one with the same name, and we don't want everything to go through our Artifactory index because of the impact on cost from the data transfer.

With Poetry, we can do this via explicit sources - is there a way to accomplish the same sort of behavior with uv?

For example, our pyproject.toml file would include this configuration:

[tool.poetry.dependencies]
python = ">=3.11,<3.12"
my-private-package = {version = "^0.12.0", source = "private_artifactory"}
rich = "^13.7.1"

[[tool.poetry.source]]
name = "PyPI"
priority = "primary"

[[tool.poetry.source]]
name = "private_artifactory"
url = "https://<organization host>/artifactory/api/pypi/pypi/simple"
priority = "explicit"
@charliermarsh
Copy link
Member

Thanks -- totally follow, we're tracking this here: #171

@charliermarsh charliermarsh closed this as not planned Won't fix, can't repro, duplicate, stale Aug 24, 2024
@menzenski
Copy link
Author

ah, thanks! totally missed that in my searching.

@charliermarsh
Copy link
Member

No prob! One thing to note: if you set your Artifactory index via extra-index-url, then by default, uv will not look in PyPI at all if a package exists in your Artifactory index. This differs from pip's behavior but protects you from dependency confusion attacks (your first requirement).

(I know it doesn't solve the second requirement of skipping your own index to save on data transfer.)

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

2 participants