Closed mihirsamdarshi closed 3 days ago
That's not a "repeated" message, poetry is (slowly) working its way through the many versions of awscli that are not compatible with the selections it has previously made at that point in the search.
There are some performance improvements in the latest beta that might help a bit, but your best bet is almost certainly to specify that you want some recent version of awscli. That will allow poetry to fail much faster - and backtrack the search and find a solution.
Thanks, I mean that it was repeatedly trying to solve. Adding in the awscli
dev and figuring out where the conflict lay did it.
We are having this problem since more than half a year. Last time clearing the poetry caches helped, this time we had to do more.
In our case we had PyYAML = "*"
and awscli ="*"
as dependencies. Poetry got stuck just as the OP outlined. When we removed PyYAML
the (seemingly) infinite loop would end and the poetry.lock
file was created in seconds. The other fix that worked was to use awscli = ">=1.25.26"
which cut that infinite loop short. This is basically the same solution that @dimbleby suggested.
I checked with the latest poetry version 1.2.0b2 and it did not help. Setting a minimum version for awscli was the only real solution for us.
@mihirsamdarshi @mkniewallner could you please explain why did you close this issue?
We are still facing the same problem with the latest Poetry release and it's reproducible in a stable way. The changed in the other issues didn't solve the problem and there is no other issue linked that is open.
If there is no other issue tracking this performance issue, could you please reopen this one?
zaytsev@parallels:~$ poetry --version
Poetry (version 1.4.2)
I am not sure if this is the problem or not for this specific issue but i am on poetry 1.5.1 and am able to get poetry to spin for a long time in a brand new project by just running
poetry init -n
poetry add 'urllib3@*' 'boto3@^1'
my understanding is that if any package selects urllib3 that is in conflict with botocore (ie >= 2.0) then your stuck downloading every boto3 library between the first time that you added the library (because poetry put ^1.x.x on whatever day you originally added it) and now (boto3 publishes new versions very often)
would it be possible to do some kind of shallow discovery of libraries that publish a lot of versions in order to select a new transitive dependency version. in this case it still resolves after a long time of downloading 100s of boto versions but only because it rules out all versions of boto and restarts at the top with a lower urllib version.
The dependency resolution is known to be quite slow of awscli
and/or botot3
are involved as there are an enormous number of versions.
The options to improve this are limited by Poetry. Best way, as others explained above, is to limit the version range that Poetry should try.
@finswimmer, would you please be so kind as to comment on what exactly limits Poetry's options to improve this, so that people facing this problem can understand why it's closed as not planned and they have to introduce an artificial lower limit to limit the packages that are scanned?
My vague understanding was that there is no metadata service, so in some cases Poetry has to download the packages from the beginning of the day to extract the metadata first to make sure they don't match, and this causes the slowness.
Is this understanding correct? If so, would it make sense to bring this up with the PyPI / PyPA people?
P.S. Just saw that in #8823 @dimbleby explained:
it's just good or bad luck whether your solver happens first to explore a path that fixes boto3 first (when it is very easy to find a satisfactory urllib3) or a path that fixes urllib3 first (when it is very hard to find a satisfactory boto3)
the most useful thing you can do right now, for future-you and the rest of the ecosystem, is to go and offer merge requests to
django-distill
orfiftyone
or whoever, putting a (recent) lower bound on theirboto3
dependency.Then no installer is exposed to having to backtrack through the thousands of versions of
boto3
that amazon release
I think that's as close to an explanation as I can get, but I'm still confused as to why backtracking through thousands of versions is a problem. It seems to me that if you have all the relevant constraints at hand, it shouldn't be difficult to solve. So is it true that constraints can only be obtained by downloading the packages in question, and that's the root cause of the issue?
So is it true that constraints can only be obtained by downloading the packages in question, and that's the root cause of the issue?
It depends:
So is it true that constraints can only be obtained by downloading the packages in question, and that's the root cause of the issue?
It depends:
- If you use PyPI as index, then dependencies of a package can be obtained without downloading the package if wheels are provided (thanks to the PEP 658 backfill). If it is an sdist only release, then (in most cases) the sdist has to be downloaded. However, even without downloading wheels or sdists, it still takes some time to backtrack thousands of versions and fetch the metadata of each version.
But OP is using PyPI and boto3 provides wheels, so the problem is really in the efficiency of Python code in this case?
Not sure if it is about Python or just network requests or the algorithm itself (independent from the programming language).
TL;DR there are many moving parts between network, algorithms, and Python, but boto having daily releases and a ton of versions to check doesn't help.
Not sure if it is about Python or just network requests or the algorithm itself (independent from the programming language).
Well, I think it makes a huge difference.
I remember that about two years ago my colleagues complaining that Poetry was saturating our 500 Mbit link, so it definitively felt like it's downloading half of the world. If nowadays it's "just" network requests and/or resolution code, then in theory something could be done about it at the Poetry side.
But I see, I guess I can only get these detailed answers by looking at the code myself :( Thank you for the pointers!
-vvv
option).Issue
With this particular
pyproject.toml
Poetry is unable to select a version ofawscli
, regardless of if I runpoetry update
,poetry install
, orpoetry lock
When running with
-vvv
it hangs with the following repeated message: