-
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
Link object being passed instead of Path to poetry.core.packages.file_dependency.FileDependency in poetry-core 1.0.5 #4541
Comments
|
Same here! I have to empty my .cache/pypoetry to make it work. Resolving dependencies... (66.1s)
Writing lock file
Package operations: 175 installs, 11 updates, 0 removals
• Updating pyrsistent (0.14.11 -> 0.18.0): Failed
AttributeError
'Link' object has no attribute 'is_absolute'
at ~/miniforge3/envs/awesome_project/lib/python3.9/site-packages/poetry/core/packages/file_dependency.py:33 in __init__
29│ self._path = path
30│ self._base = base or Path.cwd()
31│ self._full_path = path
32│
→ 33│ if not self._path.is_absolute():
34│ try:
35│ self._full_path = self._base.joinpath(self._path).resolve()
36│ except FileNotFoundError:
37│ raise ValueError("Directory {} does not exist".format(self._path))
• Installing traitlets (5.1.0): Failed
AttributeError
'Link' object has no attribute 'is_absolute'
at ~/miniforge3/envs/awesome_project/lib/python3.9/site-packages/poetry/core/packages/file_dependency.py:33 in __init__
29│ self._path = path
30│ self._base = base or Path.cwd()
31│ self._full_path = path
32│
→ 33│ if not self._path.is_absolute():
34│ try:
35│ self._full_path = self._base.joinpath(self._path).resolve()
36│ except FileNotFoundError:
37│ raise ValueError("Directory {} does not exist".format(self._path))
ERROR: Stopping generation because p |
Clearing the cache hasn't changed the behavior I'm experiencing. But the fact that that the Link object is being passed indicates that there's a commonality. |
I had the same issue because I had recently pinned poetry but not poetry-core. I had poetry pinned to 1.1.7, which worked with poetry-core-1.0.5. After poetry-core was updated to 1.0.6, poetry 1.1.7 stopped working and starts to exhibit the behaviour described above. @mrogaski Seeing that you are using poetry-core-1.0.5 try to update poetry-core to 1.0.6 and see if that solves that issue for you, too. |
Thanks for this last comment, indeed I did not notice that poetry-core was not locked if I lock poetry itself. And this resulted in poetry-core version slowly drifting until it was no longer compatible. This looks like yet another hole in the net somehow, though? |
No, 1.0.6 is also impacted.
|
Also experiencing this on poetry 1.1.8 + core 1.0.5. Downgrading to 1.1.7 and core 1.0.4 resolved my issue |
Is it possible to install poetry using poetry itself. This would help since poetry respects lock file and would consistently install core 1.0.3 instead of whatever is available at the time of install? I would install latest poetry into separate location and use it to install the specific poetry version in my environment. |
Can you ckeck if #4531 fixes this for you? |
This appears to fix the issue. I was able to reproduce the behavior from the 1.2.0a2 master and I don't encounter the problem with the fix applied. |
I found |
`poetry install` raised: `AttributeError: 'Link' object has no attribute 'is_absolute'` during build on platform.sh. It appears that it's possible for poetry-core to update even if poetry is locked. Our issue wasa caused by a regression introduced in 1.0.4. Updated poetry following the advice in the linked github issue and updated pip to fix an issue selecting the correct wheel for cryptography 36.0.0 on platform.sh. Locked Poetry to 1.1.12 and pip to 21.3.1 for docker and platform.sh Related issues: - [Link object being passed instead of Path to poetry.core.packages.file_dependency.FileDependency in poetry-core 1.0.5](python-poetry/poetry#4541) - [fix: Broken cache on Windows #4531](python-poetry/poetry#4531)
`poetry install` raised: `AttributeError: 'Link' object has no attribute 'is_absolute'` during build on platform.sh. It appears that it's possible for poetry-core to update even if poetry is locked. Our issue wasa caused by a regression introduced in 1.0.4. Updated poetry following the advice in the linked github issue and updated pip to fix an issue selecting the correct wheel for cryptography `36.0.0` on platform.sh. Locked Poetry to `1.1.12` and pip to `21.3.1` for docker and platform.sh Related issues: - [Link object being passed instead of Path to poetry.core.packages.file_dependency.FileDependency in poetry-core 1.0.5](python-poetry/poetry#4541) - [fix: Broken cache on Windows #4531](python-poetry/poetry#4531)
The solution in my case (poetry 1.1.6) was to run |
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
I can easily reproduce the issue moving from poetry-core 1.0.4 to 1.0.5, where I have the project directory and the Poetry cache directory on separate volumes (where there is no absolute path to the cache directory from the CWD). I can also reproduce the problem where the cache and CWD are co-located on a drive mapped with the SUBST command, likely because the cache is showing up as being on a different volume.
This is in a freshly cloned poetry-core project.
The text was updated successfully, but these errors were encountered: