-
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
poetry lock
failing with OverrideNeeded and AssertionError on 1.2.0b2
#5791
Comments
Found out this happens if |
https://github.com/python-poetry/poetry-core/blob/2bfcbe49dd887e1527e4e5e22cbd14caf4d9126a/src/poetry/core/semver/version.py#L92-L94 has the result that the constraint "=0.10.5" allows the version "0.10.5.post0". But because this is unsymmetrical: when we intersect the constraints "==0.10.5" and "==0.10.5.post0" we get #379 is potentially relevant, inasmuch as it looks as though it introduces a similar asymmetry for local labels. (But if I'm right that introduces more instances of this problem, rather than fixing any.) |
maybe |
diff --git a/src/poetry/core/semver/version.py b/src/poetry/core/semver/version.py
index 417d23a..356ac9e 100644
--- a/src/poetry/core/semver/version.py
+++ b/src/poetry/core/semver/version.py
@@ -107,6 +107,9 @@ class Version(PEP440Version, VersionRangeConstraint):
if other.allows(self):
return self
+ if isinstance(other, Version) and self.allows(other):
+ return other
+
return EmptyConstraint()
def union(self, other: VersionConstraint) -> VersionConstraint: perhaps. |
Interestingly enough, according to PEP 440, I'd say it is correct that the intersection is empty. However, "==0.10.5" should not allow the version "0.10.5.post0" so the post release should never be selected in this example. I created python-poetry/poetry-core#396 to address this. |
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. |
-vvv
option).Issue
A simple
poetry lock
fails when I updated to 1.2.0b2. Downgrading to 1.2.0b1 succeeds the command as usual.Error:
The text was updated successfully, but these errors were encountered: