ya-mori / python-monorepo

monorepo sample using python and poetry
113 stars 11 forks source link

Transitive dependencies cannot be built #2

Closed johannesjasper closed 3 years ago

johannesjasper commented 3 years ago

I am trying to build project-one. However, when it tries to build lib-one, it also needs to build the logging lib, which fails. I think, it has to do with the relative paths, that don't match depending from where you build the porject.

Can you tell me what I am doing wrong?

Steps to reproduce

  1. Checkout the repo
  2. run poetry install
  3. run cd projects/project-one
  4. run poetry install

    
    • Installing lib-one (0.1.0 xxx/python-monorepo/libs/lib-one): Failed
    
    EnvCommandError
    
    Command ['/xxx/.cache/pypoetry/virtualenvs/project-one-fVJqddUj-py3.8/bin/pip', 'install', '--no-deps', '-U', 'xxx/python-monorepo/libs/lib-one'] errored with the following return code 1, and output: 
    Looking in indexes: xxx (private repo)
    Processing xxx/python-monorepo/libs/lib-one
    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: xxx/.cache/pypoetry/virtualenvs/project-one-fVJqddUj-py3.8/bin/python xxx/.cache/pypoetry/virtualenvs/project-one-fVJqddUj-py3.8/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmp_wre553_
           cwd: /tmp/pip-req-build-4beifv24
      Complete output (16 lines):
      Traceback (most recent call last):
        File "xxx/.cache/pypoetry/virtualenvs/project-one-fVJqddUj-py3.8/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
          main()
        File "xxx/.cache/pypoetry/virtualenvs/project-one-fVJqddUj-py3.8/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "xxx/.cache/pypoetry/virtualenvs/project-one-fVJqddUj-py3.8/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 133, in prepare_metadata_for_build_wheel
          return hook(metadata_directory, config_settings)
        File "/tmp/pip-build-env-i0p3l6n2/overlay/lib/python3.8/site-packages/poetry/core/masonry/api.py", line 34, in prepare_metadata_for_build_wheel
          poetry = Factory().create_poetry(Path(".").resolve())
        File "/tmp/pip-build-env-i0p3l6n2/overlay/lib/python3.8/site-packages/poetry/core/factory.py", line 91, in create_poetry
          self.create_dependency(name, constraint, root_dir=package.root_dir)
        File "/tmp/pip-build-env-i0p3l6n2/overlay/lib/python3.8/site-packages/poetry/core/factory.py", line 242, in create_dependency
          dependency = DirectoryDependency(
        File "/tmp/pip-build-env-i0p3l6n2/overlay/lib/python3.8/site-packages/poetry/core/packages/directory_dependency.py", line 36, in __init__
          raise ValueError("Directory {} does not exist".format(self._path))
      ValueError: Directory ../logger does not exist
      ----------------------------------------
    ERROR: Command errored out with exit status 1: xxx/.cache/pypoetry/virtualenvs/project-one-fVJqddUj-py3.8/bin/python xxx/.cache/pypoetry/virtualenvs/project-one-fVJqddUj-py3.8/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmp_wre553_ Check the logs for full command output.
    
    at ~/.local/lib/python3.8/site-packages/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):
ya-mori commented 3 years ago

@johannesjasper

Thanks for posting the issue. I've fixed it, please try the command again.

  1. run cd projects/project-one
  2. run poetry install