question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

poetry build error with path develop dependency

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).

Issue

Running poetry build with a directory develop dependency results in multiple errors. the initial traceback (with -vvv) is in the gist, and results from a relative path usage when using a directory dependency, simply adding a self._full_path = (self._base / self._path).resolve() to line 33 of directory_dependency works past that. with that fix the second error occurs when trying to build the wheel (post successful sdist build),

 [ValueError]
Directory /private/var/folders/m0/9m4c62yx3sd12290vsfcc14m0000gn/T does not seem to be a Python package

Traceback (most recent call last):
  File "/Users/kapilt/.poetry/lib/poetry/_vendor/py3.8/clikit/console_application.py", line 131, in run
    status_code = command.handle(parsed_args, io)
  File "/Users/kapilt/.poetry/lib/poetry/_vendor/py3.8/clikit/api/command/command.py", line 120, in handle
    status_code = self._do_handle(args, io)
  File "/Users/kapilt/.poetry/lib/poetry/_vendor/py3.8/clikit/api/command/command.py", line 171, in _do_handle
    return getattr(handler, handler_method)(args, io, self)
  File "/Users/kapilt/.poetry/lib/poetry/_vendor/py3.8/cleo/commands/command.py", line 92, in wrap_handle
    return self.handle()
  File "/Users/kapilt/.poetry/lib/poetry/console/commands/build.py", line 30, in handle
    builder.build(fmt)
  File "/Users/kapilt/.poetry/lib/poetry/masonry/builder.py", line 21, in build
    return builder.build()
  File "/Users/kapilt/.poetry/lib/poetry/masonry/builders/complete.py", line 55, in build
    Factory().create_poetry(tmpdir),
  File "/Users/kapilt/.poetry/lib/poetry/factory.py", line 99, in create_poetry
    package.add_dependency(name, constraint)
  File "/Users/kapilt/.poetry/lib/poetry/packages/package.py", line 326, in add_dependency
    dependency = DirectoryDependency(
  File "/Users/kapilt/.poetry/lib/poetry/packages/directory_dependency.py", line 51, in __init__
    raise ValueError(

Its a little unclear what should happen here, the directory dep is to help model packaging for a dev environment for a mono repo with several packages. for publishing/building it would be nice to just resolve the dependency to its name and version and insert that metadata into the wheel egg.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

8reactions
misterjoacommented, Jun 16, 2020

Hello everyone, we are also facing this as we have a monorepo and want to be able to build dev packages locally and use defined versions of packages in prod. Seems related to https://github.com/python-poetry/poetry/issues/1168

8reactions
adamalcommented, Jun 1, 2020

Given this comment, I’d like to point to the usefulness of having the source (or “compiled” package) included in the build output (as opposed to just the package name).

This allows for using Poetry to build distributable/deployable packages containing local packages that may be shared between projects, without needing to deploy the dependencies to a remote package repo, reducing complexity of the build system.

Analogously, in C# it’s trivial to depend on other local projects, whose resulting .dll will be included in the referencing solution’s build output.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Imports from a poetry path dependency does not resolve
TL;DR: Pycharm won't resolve imports from a poetry path dependency. Running the code works, but the import has red lines under it and...
Read more >
Poetry with a path depedency on a package ... - Stack Overflow
Try this, i.e. duplicate your dependency package-a in the dev dependencies, so that it is a path dependency only in dev. Maybe this...
Read more >
History | Poetry - Python dependency management and ...
Path dependency metadata is unconditionally re-locked (#6843). ... Fix an issue where poetry show --outdated failed with a runtime error related to direct ......
Read more >
Dependency Management With Python Poetry
Learn how Python Poetry will help you start new projects, maintain existing ones, and master dependency management.
Read more >
Poetry - The Blue Book
Check what packages are using the dependency. Search if there is an issue asking the maintainers to update their dependencies, if it doesn't...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found