Link object being passed instead of Path to poetry.core.packages.file_dependency.FileDependency in poetry-core 1.0.5
See original GitHub issue- 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 (
-vvv
option).
X:\poetry-core>pip freeze | grep poetry
poetry==1.1.8
poetry-core==1.0.5
X:\poetry-core>poetry debug
Poetry
Version: 1.1.8
Python: 3.9.4
Virtualenv
Python: 3.9.4
Implementation: CPython
Path: X:\poetry-core\.venv
Valid: True
System
Platform: win32
OS: nt
Python: c:\users\mrogaski\appdata\local\programs\python\python39
X:\poetry-core>poetry config --list
cache-dir = "C:\\Users\\mrogaski\\AppData\\Local\\pypoetry\\Cache"
experimental.new-installer = true
installer.parallel = true
settings.virtualenvs.create = true
virtualenvs.create = true
virtualenvs.in-project = true
virtualenvs.path = "{cache-dir}\\virtualenvs" # C:\Users\mrogaski\AppData\Local\pypoetry\Cache\virtualenvs
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.
X:\poetry-core>poetry install
Creating virtualenv poetry-core in X:\poetry-core\.venv
Installing dependencies from lock file
Package operations: 41 installs, 0 updates, 0 removals
• Installing pyparsing (2.4.7)
• Installing six (1.15.0)
AttributeError
'Link' object has no attribute 'is_absolute'
at c:\users\mrogaski\appdata\local\programs\python\python39\lib\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))
AttributeError
'Link' object has no attribute 'is_absolute'
at c:\users\mrogaski\appdata\local\programs\python\python39\lib\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))
Issue Analytics
- State:
- Created 2 years ago
- Reactions:8
- Comments:13 (2 by maintainers)
Top Results From Across the Web
Poetry | AttributeError 'Link' object has no attribute 'name'
In my case (poetry 1.1.6) I solved it by clearing the artifacts cache before poetry install : rm -rf $HOME/.cache/pypoetry/artifacts/*.
Read more >poetry-core - PyPI
A PEP 517 build backend implementation developed for Poetry. This project is intended to be a light weight, fully compliant, self-contained package allowing ......
Read more >Configure a Poetry environment | PyCharm Documentation
Poetry is a tool that facilitates creating a Python virtual environment based on the project dependencies. You can declare the libraries your project ......
Read more >poetry-core - Python Package Health Analysis - Snyk
As such, we scored poetry-core popularity level to be Influential project. Based on project statistics from the GitHub repository for the PyPI package...
Read more >Poetry: Finally an all-in-one tool to manage Python packages
If you are new in python programming and don't know how to manage your project dependencies, then this tutorial is for you.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
Can you ckeck if #4531 fixes this for you?