-
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
repository.secondary=true + dependency.source broken? #5122
Comments
I see this as well, for my case I only add a secondary source for publishing. No deps come from the secondary source when building. However, |
I observe the same and wondered that the |
This is expected behavior. See https://python-poetry.org/docs/master/repositories/#secondary-package-sources. |
Well ok, but what is the alternative as the performance is very poor? Create a pypi primary source as default, mark as defaut, specify all packages being checked against the one explicitly and only for the 1-2 packages being secondary, specify the secondary? The last time I checked I could not do that, because perf of legacy repos was poor and I could not add pypy as a non-legacy... @abn what is your suggestion? |
poetry source add --secondary foo url
poetry add pycowsay --source=pypi
poetry add secret-package --source=foo This should work out of the box. Note you don't have to add PyPI as a source. But I suspect requests for transient dependencies will still query both repositories at present. For more context see #3855 (comment) #5442 should improve this situation. But the real fix for avoiding all requests will be a new feature to specify a source as something that is queried for explicit packages only. But this introduces a different challenge for transient dependencies. |
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. |
I am on the latest Poetry version.
I have searched the issues of this repo and believe that this is not a duplicate.
If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).OS version and name: MAC OS
Poetry version: 1.1.12
Link of a Gist with the contents of your pyproject.toml file: https://gist.github.com/pierresouchay/60f3e8b9e20ee0d23f0e4604c7a73019
Issue
Following a discussion on #4920
When creating a source called "my-source" with
secondary=true
, I was expecting the repository to be hit under those conditions:This is actually not the case, the repository my-source is actually hit each time for every package, for instance when doing a poetry update.
This is causing a few issues if "my-source" is very slow for instance, as time increase on my local setup from 5s to 120s (a project with lots of dependencies).
Is there is a way to use "my-source" ONLY for a few packages?
Here is the output of
poetry update -vvv
with the pyproject.toml from https://gist.github.com/pierresouchay/60f3e8b9e20ee0d23f0e4604c7a73019 👍In this example, I used:
The dependencies:
As shown, all packages are checked on my-source, while I expect only
changelog
to be checked against this repo.If my source takes 1 sec to respond, the update process takes a very long time... Is it working as intended, but if so, could it be explained better or is it a bug?
If working as intended, would it be possible to use a source ONLY for the packages I want by default?
The text was updated successfully, but these errors were encountered: