Repository navigation
Closed
Closed
Copy link
Labels
kind/bugSomething isn't working as expectedSomething isn't working as expected
Description
- 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 (
-vvvoption).
Gist of output is: https://gist.github.com/mdengler/7be12f9c481567c7872bc2ea712464b6
- OS version and name: Fedora 34
$ cat /etc/fedora-release
Fedora release 34 (Thirty Four)
- Poetry version: Poetry version 1.1.6
$ poetry --version
Poetry version 1.1.6
- Link of a Gist with the contents of your pyproject.toml file: Unpublished software, so if there is a need for this file, I can provide privately.
Issue
I have received this error message:
$ poetry update
Updating dependencies
Resolving dependencies... (34.4s)
Writing lock file
AttributeError
'EmptyConstraint' object has no attribute 'allows'
at ~/.local/lib/python3.9/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│
I made this change as a workaround:
$ diff -uw ~/.local/lib/python3.9/site-packages/poetry/core/version/markers.py{~,}
--- /home/martin/.local/lib/python3.9/site-packages/poetry/core/version/markers.py~ 2021-04-21 11:44:56.085692322 -0400
+++ /home/martin/.local/lib/python3.9/site-packages/poetry/core/version/markers.py 2021-08-19 11:38:17.934769254 -0400
@@ -288,6 +288,9 @@
if self._name not in environment:
return True
+ if not hasattr(self._constraint, "allows"):
+ return True
+
return self._constraint.allows(self._parser(environment[self._name]))
def without_extras(self): # type: () -> MarkerTypes
$ diff -uw ~/.local/lib/python3.9/site-packages/poetry/core/version/markers.py{~,}
--- /home/martin/.local/lib/python3.9/site-packages/poetry/core/version/markers.py~ 2021-04-21 11:44:56.085692322 -0400
+++ /home/martin/.local/lib/python3.9/site-packages/poetry/core/version/markers.py 2021-08-19 11:38:17.934769254 -0400
@@ -288,6 +288,9 @@
if self._name not in environment:
return True
+ if not hasattr(self._constraint, "allows"):
+ return True
+
return self._constraint.allows(self._parser(environment[self._name]))
def without_extras(self): # type: () -> MarkerTypes
I gathered some extra debugging information that points to greenlet and sqlalchemy as being involved in the issue: https://gist.github.com/mdengler/7be12f9c481567c7872bc2ea712464b6
Reacted by Erik Bjäreholt, Remi Rampin, Robert, gerritsanetra, Kai Norman Clasen, oktavlachs, Samy AB, Reynold Chery and Hayato Tsukagoshi
Metadata
Metadata
Assignees
Labels
kind/bugSomething isn't working as expectedSomething isn't working as expected
Activity
elbakramer commentedon Aug 19, 2021
Upgrading poetry to 1.1.8 may solve the issue.
Check #4402 for for more information.
mdengler commentedon Aug 19, 2021
Thanks -- looks like this is a dupe, then.
mrtolkien commentedon Aug 26, 2021
I have the same issue with the current preview build, poetry
1.2.0a2Will there be another preview build that fixes it?
bipinkc19 commentedon Sep 2, 2021
Been getting the same problem.
alanorth commentedon Sep 4, 2021
I'm doing
poetry updatewith poetry 1.1.8 on a project that indirectly includes sqlalchemy and I get this error too:Link to pyproject.toml.
tcaiazza commentedon Sep 7, 2021
I get the same error as others, 'EmptyConstraint' object has no attribute 'allows' and through some trail and error it looks like the issue is with sqlalchemy version 1.4.23. If I pin it to 1.4.22 everything works as expected.
Note: i'm using poetry 1.2.0a1
mahenzon commentedon Sep 8, 2021
Yeah, happens with sqlalchemy
platform_machine in "x86_64 X86_64 aarch64 AARCH64 ppc64le PPC64LE amd64 AMD64 win32 WIN32"seems to be unexpected for poetryalanorth commentedon Sep 9, 2021
@errsolve7 this is not solved with Poetry 1.1.8 or current master, as several commenters and I have noted.
sodality-ramsey commentedon Sep 9, 2021
Please do not follow this link, this user is attempting a phishing scam. Comment is reported.
As an aside, updating to Poetry 1.1.8 fixed the
AttributeError: 'EmptyConstraint' object has no attribute 'allows'error for me.mahenzon commentedon Sep 9, 2021
Yeah, fixed for me too in 1.1.8, was getting it with 1.1.7
pengfei99 commentedon Sep 11, 2021
Also fixed for me too in 1.1.8, was getting it with 1.1.6
fulopkovacs commentedon Oct 1, 2021
Pinning sqlalchemy to
1.4.22solved this problem for me too (I'm using poetry1.1.0). What's weird is that this problem does not occur in our CI where we use images based onpython:3.6.x-slimandpython:3.8.x. I have Python 3.9 installed on my computer (Manjaro Linux) and all the previous commenters whose logs I've seen so far are using Python 3.9 too. Maybe it's an issue with Python 3.9? Just a thought, though, I haven't actually tested it.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.