Skip to content

Link object being passed instead of Path to poetry.core.packages.file_dependency.FileDependency in poetry-core 1.0.5 #4541

@mrogaski

Description

@mrogaski
  • 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))

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions