-
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
fix: fix exception on invalid url dependency for current env #7953
fix: fix exception on invalid url dependency for current env #7953
Conversation
this isn't a Really it's just a plain bug: if left unfixed then suggest that |
ec672ff
to
d23daa7
Compare
@dimbleby I think I didn't get what bug exactly are you referring to, isn't this a user error? |
Same here. Do you think it's a bug that it's possible to lock something like this and the error only pops up in the executor? |
While technically you could avoid locking my example in the first place, I think there's other situations in which you really can't know until you install (different os, different arch, ..), so I think this error handling is still valid. Plus, it feels consistent with the current "lock everything" behaviour of Poetry. |
I definitely think that this error popping up in
I'm fine with this MR being an incremental improvement: but it's very strange to me that checking an archive for suitability for the current environment happens (i) during download and (ii) only if the archive was in the cache. (What's the behaviour in that repro with |
It doesn't. #7693 (comment) And definitely agree on the behaviour of |
d23daa7
to
a8745be
Compare
I agree that
The check is always executed, no matter if the artifact was in the cache before. If it was not in the cache it is downloaded and put into the cache before this check. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
The
Executor
first downloads and caches the original artifact, then tries to fetch a higher priority cached artifact (i.e. a wheel instead of a sdist) to speed up the installation, falling back on the previously downloaded original artifact. Therefore it was assumed that whatever cached artifact gets returned, it will not be None.The assumption however is wrong since the cached artifact search is filtered for the given environment, i.e. if even the original artifact is invalid for the current environment than
artifact
will actually be None, raising a quite mysterious exception. This can happen for instance in this case:The fix simply transforms that mysterious exception into a more self-explanatory one.