-
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
Error when adding package: EmptyConstraint instance has no attribute 'min' #534
Comments
Update: When I use
This fails with the same I can install
|
There was an issue when parsing some transitive markers. It has been fixed in commit 7761867 |
This has been fixed in the latest release. |
Thank you!
…On Mon, Oct 22, 2018 at 7:08 PM Sébastien Eustace ***@***.***> wrote:
Closed #534 <#534>.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#534 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABIVaXpKGlHCIOw-6UzEPNG3vjhOTMs-ks5unk_VgaJpZM4XwqLv>
.
|
I think there's been a regression here; I get the same error with 0.12.16: $ poetry -V
Poetry 0.12.16
$ poetry add jupyter
[AttributeError]
'EmptyConstraint' object has no attribute 'min'
add [-D|--dev] [--git GIT] [--path PATH] [-E|--extras EXTRAS] [--optional] [--python PYTHON] [--platform PLATFORM] [--allow-prereleases] [--dry-run] [--] <name> (<name>)... |
Got the same error with 0.12.17 & Python version 3.7.4; same prompt as @flaviut 's comment. It seems to be |
Also getting this error with Poetry
from poetry.semver import Version
from poetry.semver import VersionUnion
from poetry.semver.empty_constraint import EmptyConstraint # this line is new and a new elif isinstance(constraint, Version):
marker = '{} == "{}"'.format(name, constraint.text)
elif isinstance(constraint, EmptyConstraint): # and this line
marker = '' # and this one
else: And now it seems to work ok |
Met this issue on Poetry 1.0.3 + Python 3.7.4 |
I'm having the same error on Poetry 1.0.9. The package I'm trying (AuHau/toggl-cli) has:
This is my debug info, and a gist below with
Poetry [AttributeError] 'EmptyConstraint' object has no attribute 'min' |
I'm experiencing this same issue with Poetry 1.1.4 when trying to install certain packages. I was able to get around the issue following a similar approach that @bnoctis and @agilgur5 detailed above. However, for a more recent vendorized install, the file I had to modify was Here's a diff of the modifications I made, hopefully others find this useful: diff --git a/tmp.py b/Users/user/.poetry/lib/poetry/_vendor/py3.8/poetry/core/packages/dependency.py
index e118794..6f97002 100644
--- a/tmp.py
+++ b/Users/user/.poetry/lib/poetry/_vendor/py3.8/poetry/core/packages/dependency.py
@@ -9,6 +9,7 @@ from poetry.core.semver import Version
from poetry.core.semver import VersionConstraint
from poetry.core.semver import VersionRange
from poetry.core.semver import VersionUnion
+from poetry.core.semver import EmptyConstraint
from poetry.core.semver import parse_constraint
from poetry.core.version.markers import AnyMarker
from poetry.core.version.markers import parse_marker
@@ -291,6 +292,8 @@ class Dependency(PackageSpecification):
name = "python_full_version"
marker = '{} == "{}"'.format(name, constraint.text)
+ elif isinstance(constraint, EmptyConstraint):
+ marker = ''
else:
if constraint.min is not None:
min_name = name System: MacOS |
Flip, tool me good 30 mins to fix it. |
Like @glencairn comment, but this works for me: elif constraint.is_empty():
marker = '' System: Ubuntu 20 P.S. Iam not sure, but this package was causing an error |
Thanks, @Ver1Sus! Tell me, how did you know that the problem was with this particular package? I'm wondering since it might happen again with another package. |
Same issue here, my poetry debug is
|
This is also happening due to a change in pytest-randomly, FWIW. |
@pksol, I'm glad that the solution helped! I ran PyPI: 8 packages found for backports.functools-lru-cache >=1.2.1
1 packages found for backports.functools-lru-cache >=1.2.1
1: Version solving took 40.500 seconds.
1: Tried 1 solutions.
[AttributeError]
EmptyConstraint instance has no attribute 'min' |
#3862 |
I'm seeing the same issue as @glencairn identified:
The patch they identified has fixed my issue. Can anyone guide me on how to identify the offending package? I think we may need to raise a fresh issue here as it seems like whatever causes this has not been resolved, or resurfaced |
I encountered the same issue and the solution of @glencairn solved the problem. My
|
I found @dem1tris's solution to be helpful - I changed |
via @pksol at #534 (comment)
|
Follow up If your issue in Workaround: @pbzweihander's fix here helped me in pyproject.toml: "backports.functools_lru_cache" = "!=1.6.2,!=1.6.3" # https://github.com/jaraco/backports.functools_lru_cache/pull/16 There is a PR to fix this here: jaraco/backports.functools_lru_cache#16 |
I had to edit
and line 281 in the definition of
|
I opened an issue for this specific error: #4410 |
Just to avoid the import in my case, I used (Or update to version 1.1.8, it apparently fixed the issue) |
Encountered this issue with poetry version 1.1.7. |
This issue still persists at poetry 1.1.12. When running |
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
Hi! This is my first time attempting to use poetry. I created a new empty project with this command:
Then, from within the
example
directory, I attempt to add thejupyter
package:Verbose output is contained within the gist linked above. I am able to add other packages without apparent error. Happy to provide additional info.
The text was updated successfully, but these errors were encountered: