-
Notifications
You must be signed in to change notification settings - Fork 2.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
How can I choose a source on a per-dependency basis? #524
Comments
For comparison's sake, the above is possible in [[source]]
url = "http://pypi.home.kennethreitz.org/simple"
name = "home"
[packages]
requests = {version="*", index="home"}
records = "*" (Edit: as @fridex pointed out, PyPi will also be queried for this dependency and PyPi's version will be used if it is higher than the one in the |
There was a prior request for this here as well. |
This is somehow by design in Python ecosystem. Indeed, this can be a security reason especially with the fact pip can silently fallback to the secondary index - it treats them all as mirrors. We have done some work around this - see our provenance checks in the Thoth project. Currently we support Pipfile and Pipfile.lock style checks. In the future there is a plan for adding PEP-518 support. See also Pipenv discussion on this in pypa/pipenv#2159 |
@fridex awesome, thank you for the links--it appears the security issues remains in It seems like currently the maximally safe way to use another source is to use that source instead of PyPi, not in addition to it. (In this case the source I want to use is pypicloud with passthrough to pypi; we're coming from |
Hmm... Though I don't see a way to use another repository instead of PyPi, only in addition to it; from the docs, emphasis mine:
|
I'd like to be able to specify a default source and then override it on a per-dependency basis. The use case is that for most of my packages I am use the public PyPI index but also have a couple private packages on a private repo. Something like this would be perfect. [[tool.poetry.source]]
name = "my-private-repo"
url = "http://<hostname>/simple/"
default = false # Disable using it by default
[tool.poetry.dependencies]
python = "^3.6"
my-private-package = { version = "^x.y.z", source = "my-private-repo }
requests = "*" # Use pypi and never look at my-private-repo |
This is now available in the latest beta release (see #908 for more information). |
https://python-poetry.org/docs/dependency-specification/ @sdispater the documentation doesn't mention the Although, to be fair, I found that I only wanted to use the secondary source for my company's proprietary packages. Explicitly defining source per package seemed to have a big help!
|
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Question
I would like to specify a source for a dependency on a per-dependency basis.
I would like to do this for a number of reasons:
Therefore it seems to me that the way to have understandable semantics and the best installation speed is to support something like:
The text was updated successfully, but these errors were encountered: