-
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
Ignore PyPI if local/private PI available? #331
Comments
To extend: |
The private repositories used to find and install packages must be specified in each The Also, the private repositories will always have priority when looking for packages but Poetry will also fallback on PyPI when a package can't be found in the private repos. |
@sdispater Thank you, that is what I think is best with the current setup. It would probably be good if that was in the documentation, because the way the documentation for custom repositories is written, it gave me the impression of having to have a repository configured both locally (poetry config) and in the project (pyproject.toml file). |
What if I had a package in my private repository, but I wanted to specify explicitly for one dependency I wanted to install the one from PyPi? # Let's say libx is in my private repo and it's used by other projects, but for this
# project I want to use the one that is publicly available on pypi for some reason.
libx = {version="^1.0.0", repository="pypi"} That could be nice in my opinion. |
@sdispater, for me it doesn't work. I have following section in my
I add a dependency with |
I would like to have a way to disable poetry using Pypi as a fallback. To make that use case a bit more clear, suppose you use devpi as a local artifact store, I worked in a company that selectively copied packages from pypi to the devpi index. This allowed for principally ruling out the installation of certain packages (due to license, security or stability conerns). Then, individual projects would configure to pull from the local repository and would not have to worry about license issues, etc. This workflow works with pure pip by providing the So to me it seems what poetry does is to configure local mirrors to pypi, a valid use case. I would like to configure repositories. |
Just to give an update on this. There is currently a work in progress (#908) that will make it possible to deactivate the fallback on PyPI by declaring a source as the default one. [[tool.poetry.source]]
name = "custom"
url = "http://example.com/simple/"
default = true This new feature will be available in the |
I have a question regarding this. I didn't find anywhere in the docs about what happens when you put multiple [[tool.poetry.source]] sections. My specific use case is also with a devpi as a local artifact store, I would like to use the LAN address as a default (what #908 will allow), the remote address as a first fallback, and pypi after. what is the expected behavior with:
|
PR #908 has been merged and is available in the |
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 have a local PyPI cache, and I'd like all my python projects to pull packages through it by default, instead of the public PI.
The general idea is, that while I'm connected to my network (local PI is available), Poetry will pull packages from/through the local PI, but as soon as I lose connection to the local network, or to the local PI, Poetry would fall back onto pulling packages directly from PyPI.
What I'm wondering about is, if specifying a local PI in the Poetry config and in the project configuration already encompasses that, and if it does, if there's a way to tell Poetry to use the local PI on every project by default. Maybe even, if you have multiple private PIs, let the user specify in which order to query them?
The text was updated successfully, but these errors were encountered: