-
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
'EmptyConstraint' object has no attribute 'allows' #4402
Comments
I faced the same issue. My problem was that I was using SQLAlchemy with version "^1.4". Here's the link: https://github.com/sqlalchemy/sqlalchemy/blob/4331c1902ae341158b597769f4e4991c0a7d5485/setup.cfg#L43. My solution was to change SQLAlchemy dependency to:
|
Thanks this helped a lot.
The above changes solved the issue for me. (Added SQLAlchemy) |
Reopening since it should not crash like this when evaluating environment markers. |
same issue here |
I think adding the offending package name to the error is crucial |
Hi, i hot fixed this by adding method allows to EmptyConstraint class:
to ./poetry/core/packages/constraints/empty_constraint.py |
Pinning the version of sqlalchemy fixed it for me. Thanks @s3rius
|
Same issue as well. Agree there should be more information on the error/offending package as it required digging into each dependency to identify the package causing the issue |
Thanks @josef-polak-heu! Perfectly solved the problem for me. |
In the sqlalchemy repo, one developer is saying that it could be due to poetry-core not able to parse correctly constraint like:
see comment here: if we look at parse_single_constraint (in poetry-core/core/package/constraints/init.py it seems that such kind of constraint is not handled by poetry and thus end as an EmptyConstraint running an interactive debugging session we can see:
So my question is for such kind of constraint string, the correct constraint type should be AnyConstraint isn't it ? On an other aspect Iam not sure that EmptyConstraint should provide a allows() that return True (maybee - see: it seems that someone already propose to add #4398 (comment)), but in my understanding, doing that will just hide the real problem here, that the constraint is not parsed correctly). I am maybee completly wrong, so don't hesitate to tell me. |
I created an issue on sqlalchemy as I don't particularly care who is at fault, just want someone to fix it. |
Resolves python-poetry/poetry#4402 # Conflicts: # poetry/core/packages/constraints/base_constraint.py # poetry/core/packages/constraints/empty_constraint.py
We have a fix ready on the We will make a new release of both |
This might help fixing python-poetry/poetry#4402
Release 1.1.8 – which hopefully fixes the issue – is out! |
Version 1.1.8 fixed the issue for me! Thanks @sdispater! |
Yes, it works, thank you!
|
Also fixed for me! |
A big "thank you" to everyone involved in describing and resolving this issue. Tomorrow I'm due to release Python code to production for the first time ever at our company. As a relative Python beginner this error had me despondent on Friday! Sunday afternoon, the issue is already fixed and the fix released. Just did a quick |
* poetry needs to be updated 1.18 or later due to python-poetry/poetry#4402
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? |
We're hit by python-poetry/poetry#4402 Signed-off-by: Aurélien Bompard <[email protected]>
We're hit by python-poetry/poetry#4402 Signed-off-by: Aurélien Bompard <[email protected]>
SQLAlchemy gets pulled in by csvkit's agate-sql dependency and there is currently an issue with Poetry's parsing of the SQLAlchemy 1.4.23 constraints. Temporarily explicitly install a version of SQLAlchemy that works (can remove later once Poetry fixes this). Anyways, I am not using any SQLAlchemy features that I know of. See: python-poetry/poetry#4402
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. |
Everything was working fine until yesterday, I cleaned up my docker ending up removing all the images, etc. The project was building fine before clean up. Post clean up when I rebuilt the docker image, I started receiving the error:
Here's my
.toml
file:And here's my dockerfile:
Here the debug logs: https://pastebin.com/sbiiDf8Z
The text was updated successfully, but these errors were encountered: