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).
- OS version and name: OS X Catalina (10.15.2)
- Poetry version: 1.0.3
- Link of a Gist with the contents of your pyproject.toml file: https://gist.github.com/kapilt/5b3808ad3e54f5ae83147d259b1f0cef
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:
- Created 4 years ago
- Comments:5
Top 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 >
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
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
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.