You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AttributeError : EmptyConstraint object has no attribute allows #4398
Tried both with python3.8 and python3.9 resulting in this same error.
AttributeError
'EmptyConstraint' object has no attribute 'allows'
at ~/anaconda3/envs/py38/lib/python3.8/site-packages/poetry/core/version/markers.py:291 in validate
287│
288│ if self._name not in environment:
289│ return True
290│
→ 291│ return self._constraint.allows(self._parser(environment[self._name]))
292│
293│ def without_extras(self): # type: () -> MarkerTypes
294│ return self.exclude("extra")
295│
Reacted by Kyle King, Thomas Lautenschläger, Anthony Taldone, Bohdan Konovalenko, Martin Rusev, George Bocharov, kosmitive, lzoeckle, Josh Wang, Noah Sayre and 19 more
Reacted by Thomas Lautenschläger, Kyle King and Ryosuke Horiuchi
Reacted by Thomas Lautenschläger, kosmitive, Maksim, Sandro Huber, Kyle King, Ryosuke Horiuchi and Guillaume
This looks like something that appeared today - all my builds (in Docker) are now failing with the exact same error. Those worked last week. I even tried the new install-poetry.py script with no success.
Edit: it was sqlalchemy which I use in all projects. Avoiding version 1.4.23 solved the issue.
I wonder if a single package was pushed to PyPi with an empty constraint and we all happen to reference it? I'm working through the dependencies for our project now
Reacted by Anthony Taldone, Maksim and Andrew Standley
Seems to be an issue with SQLAlchemy 1.4.23 that was released ~3 hours ago. Can someone open an issue with them if not already? After work, I can submit an issue otherwise
A temporary workaround is pinning to 1.4.22 (sqlalchemy="1.4.22")
Reacted by SeungHoon Choi, Ryosuke Horiuchi and spoqa-teo
Reacted by Thomas Lautenschläger, Anthony Taldone, SeungHoon Choi, Ryosuke Horiuchi and Kuza
this is a poetry issue. SQLAlchemy is using https://www.python.org/dev/peps/pep-0508/ specifiers and as far as we can tell, the syntax is valid. There is no issue with our software installing with pip.
This is a bug. Is a very obvious bug for 1.1.7. The EmptyConstraint class does not implement the allows method. Just implementing it to return True appeared to fix it in my case, though I'm not clear entirely clear if a blanket True is the correct behaviour.
Does anyone know if the contribution rules for poetry-core are the same as poetry? I'm happy to try and propose a fix, but want to make sure I'm following the correct procedure.
This seems to be fixed in poetry 1.1.8. poetry self update solved the issue for me, thanks to whoever fixed it 👍 @KeksTheAllmighty maybe you can close this ticket?
This seems to be fixed in poetry 1.1.8. poetry self update solved the issue for me, thanks to whoever fixed it 👍
KeksTheAllmighty maybe you can close this ticket?
Given #4429 and the fact that this error is in poetry-core, can one of the maintainers comment whether upgrading poetry-core>=1.0.4 is the better fix?
this issue/bug still exists for poetry 1.2.0a2, i think need to be reopened. or the changes 1.1.8 has needs to be imported into 1.2.0a2 if missing
see #4410
this issue/bug still exists for poetry 1.2.0a2, i think need to be reopened
No, the fix was made in poetry-core. In the 1.0 branch and the master branch. There was a release 1.0.4 which is used by poetry 1.1.8. But the poetry preview release still uses poetry-core 1.1.0a6. I think with the next preview release of poetry, there will be also a new release for poetry-core which then contains the fix..
Activity
KyleKing commentedon Aug 18, 2021
Can you run
poetry install -vvv? We ran into the same issue just nowKeksTheAllmighty commentedon Aug 18, 2021
Sure, here is the full stacktrace (for python3.9 this time)
georgebv commentedon Aug 18, 2021
This looks like something that appeared today - all my builds (in Docker) are now failing with the exact same error. Those worked last week. I even tried the new
install-poetry.pyscript with no success.Edit: it was
sqlalchemywhich I use in all projects. Avoiding version 1.4.23 solved the issue.KyleKing commentedon Aug 18, 2021
I wonder if a single package was pushed to PyPi with an empty constraint and we all happen to reference it? I'm working through the dependencies for our project now
KeksTheAllmighty commentedon Aug 18, 2021
the problem seems to be with the newest
sqlalchemyin my case ...dtklein7 commentedon Aug 18, 2021
From inspecting the object with the EmptyMarker:
And inspecting my lockfile:
I have a hunch the issue might be the
greenletdependency, which in my case is required bysqlalchemy.KyleKing commentedon Aug 18, 2021
Seems to be an issue with SQLAlchemy 1.4.23 that was released ~3 hours ago. Can someone open an issue with them if not already? After work, I can submit an issue otherwise
A temporary workaround is pinning to 1.4.22 (
sqlalchemy="1.4.22")zzzeek commentedon Aug 18, 2021
hey there -
this is a poetry issue. SQLAlchemy is using https://www.python.org/dev/peps/pep-0508/ specifiers and as far as we can tell, the syntax is valid. There is no issue with our software installing with pip.
airstandley commentedon Aug 18, 2021
This is a bug. Is a very obvious bug for 1.1.7. The EmptyConstraint class does not implement the allows method. Just implementing it to return True appeared to fix it in my case, though I'm not clear entirely clear if a blanket True is the correct behaviour.
airstandley commentedon Aug 18, 2021
On closer inspection, I'm not sure whether this issue should be raised in poetry core? It does appear the bug exists on master (https://github.com/python-poetry/poetry-core/blob/5812d6db7ae95ac0dd11b498e47f3c3f17a27857/poetry/core/packages/constraints/empty_constraint.py#L10)
Edit: Neither BaseConstraint, nor EmptyConstraint have an
allowsmethod, even though all the other concrete constraint implementations do. The check in markers.py appears to be crashing with deps that have no constraints as a result of this mismatch in the interface. I'm guess this maybe never came up because it's extremely rare to have no constraint on a dependency.airstandley commentedon Aug 18, 2021
Does anyone know if the contribution rules for poetry-core are the same as poetry? I'm happy to try and propose a fix, but want to make sure I'm following the correct procedure.
airstandley commentedon Aug 18, 2021
Put up python-poetry/poetry-core#187. Hopefully it's correct, and fixes this issue.
laurentS commentedon Aug 23, 2021
This seems to be fixed in poetry 1.1.8.
poetry self updatesolved the issue for me, thanks to whoever fixed it 👍@KeksTheAllmighty maybe you can close this ticket?
KeksTheAllmighty commentedon Aug 23, 2021
Am closing the ticket as it was resolved. Thank you all.
dwyatte commentedon Aug 24, 2021
Given #4429 and the fact that this error is in poetry-core, can one of the maintainers comment whether upgrading poetry-core>=1.0.4 is the better fix?
shelper commentedon Sep 16, 2021
this issue/bug still exists for poetry 1.2.0a2, i think need to be reopened. or the changes 1.1.8 has needs to be imported into 1.2.0a2 if missing
see #4410
finswimmer commentedon Sep 16, 2021
No, the fix was made in poetry-core. In the 1.0 branch and the master branch. There was a release 1.0.4 which is used by poetry 1.1.8. But the poetry preview release still uses poetry-core 1.1.0a6. I think with the next preview release of poetry, there will be also a new release for poetry-core which then contains the fix..
github-actions commentedon Mar 2, 2024
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.