Skip to content

Nested relative directory dependency failing to resolve. #3098

@goofiva

Description

@goofiva
  • 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).

Issue

I'm having trouble installing complex (but not circular) nested relative dependencies.

This was working in poetry v1.0.5.

Please see this public repo for replicating this error.

https://github.com/goofiva/poetry-directory-dependency

➜  package-a git:(main) ✗ poetry install -vvv
Creating virtualenv package-a-iE34YiwS-py3.9 in /Users/va/Library/Caches/pypoetry/virtualenvs
Using virtualenv: /Users/va/Library/Caches/pypoetry/virtualenvs/package-a-iE34YiwS-py3.9
Installing dependencies from lock file

Finding the necessary packages for the current system

Package operations: 3 installs, 0 updates, 0 removals

  • Installing package-c (0.1.0 /Users/va/wp/poetry_dependency_bug/package-c): Pending...
  • Installing package-c (0.1.0 /Users/va/wp/poetry_dependency_bug/package-c): Building...
  • Installing package-c (0.1.0 /Users/va/wp/poetry_dependency_bug/package-c)
  • Installing package-b (0.1.0 /Users/va/wp/poetry_dependency_bug/package-b): Pending...
  • Installing package-b (0.1.0 /Users/va/wp/poetry_dependency_bug/package-b): Building...
  • Installing package-b (0.1.0 /Users/va/wp/poetry_dependency_bug/package-b): Failed

  EnvCommandError

  Command ['/Users/va/Library/Caches/pypoetry/virtualenvs/package-a-iE34YiwS-py3.9/bin/pip', 'install', '--no-deps', '-U', '/Users/va/wp/poetry_dependency_bug/package-b'] errored with the following return code 1, and output:
  Processing /Users/va/wp/poetry_dependency_bug/package-b
    Installing build dependencies: started
    Installing build dependencies: finished with status 'done'
    Getting requirements to build wheel: started
    Getting requirements to build wheel: finished with status 'done'
      Preparing wheel metadata: started
      Preparing wheel metadata: finished with status 'error'
      ERROR: Command errored out with exit status 1:
       command: /Users/va/Library/Caches/pypoetry/virtualenvs/package-a-iE34YiwS-py3.9/bin/python /Users/va/Library/Caches/pypoetry/virtualenvs/package-a-iE34YiwS-py3.9/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /var/folders/kz/_9xwzxsn5l5gb96yc414fm3r0000gn/T/tmpea5bsf0z
           cwd: /private/var/folders/kz/_9xwzxsn5l5gb96yc414fm3r0000gn/T/pip-req-build-2mbl5clu
      Complete output (16 lines):
      Traceback (most recent call last):
        File "/Users/va/Library/Caches/pypoetry/virtualenvs/package-a-iE34YiwS-py3.9/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
          main()
        File "/Users/va/Library/Caches/pypoetry/virtualenvs/package-a-iE34YiwS-py3.9/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/Users/va/Library/Caches/pypoetry/virtualenvs/package-a-iE34YiwS-py3.9/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py", line 133, in prepare_metadata_for_build_wheel
          return hook(metadata_directory, config_settings)
        File "/private/var/folders/kz/_9xwzxsn5l5gb96yc414fm3r0000gn/T/pip-build-env-9cya5uui/overlay/lib/python3.9/site-packages/poetry/core/masonry/api.py", line 34, in prepare_metadata_for_build_wheel
          poetry = Factory().create_poetry(Path(".").resolve())
        File "/private/var/folders/kz/_9xwzxsn5l5gb96yc414fm3r0000gn/T/pip-build-env-9cya5uui/overlay/lib/python3.9/site-packages/poetry/core/factory.py", line 91, in create_poetry
          self.create_dependency(name, constraint, root_dir=package.root_dir)
        File "/private/var/folders/kz/_9xwzxsn5l5gb96yc414fm3r0000gn/T/pip-build-env-9cya5uui/overlay/lib/python3.9/site-packages/poetry/core/factory.py", line 242, in create_dependency
          dependency = DirectoryDependency(
        File "/private/var/folders/kz/_9xwzxsn5l5gb96yc414fm3r0000gn/T/pip-build-env-9cya5uui/overlay/lib/python3.9/site-packages/poetry/core/packages/directory_dependency.py", line 36, in __init__
          raise ValueError("Directory {} does not exist".format(self._path))
      ValueError: Directory ../package-c does not exist
      ----------------------------------------
  ERROR: Command errored out with exit status 1: /Users/va/Library/Caches/pypoetry/virtualenvs/package-a-iE34YiwS-py3.9/bin/python /Users/va/Library/Caches/pypoetry/virtualenvs/package-a-iE34YiwS-py3.9/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /var/folders/kz/_9xwzxsn5l5gb96yc414fm3r0000gn/T/tmpea5bsf0z Check the logs for full command output.
  WARNING: You are using pip version 20.2.2; however, version 20.2.3 is available.
  You should consider upgrading via the '/Users/va/Library/Caches/pypoetry/virtualenvs/package-a-iE34YiwS-py3.9/bin/python -m pip install --upgrade pip' command.


  at ~/.poetry/lib/poetry/utils/env.py:948 in _run
       944│                 output = subprocess.check_output(
       945│                     cmd, stderr=subprocess.STDOUT, **kwargs
       946│                 )
       947│         except CalledProcessError as e:
    →  948│             raise EnvCommandError(e, input=input_)
       949│
       950│         return decode(output)
       951│
       952│     def execute(self, bin, *args, **kwargs):

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