Install failure in more than two nested subprojects
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: 10.15.2 macOS
- Poetry version: 1.0.0
Issue
a
├── a
│ └── __init__.py
├── b
│ ├── b
│ │ └── __init__.py
│ ├── c
│ │ ├── c
│ │ │ └── __init__.py
│ │ └── pyproject.toml
│ └── pyproject.toml
└── pyproject.toml
5 directories, 6 files
Execute
cat a/pyproject.toml
[tool.poetry]
name = "a"
version = "0.1.0"
description = ""
authors = ["Your Name <you@example.com>"]
[tool.poetry.dependencies]
python = "^3.8"
b = {path = "b"}
[tool.poetry.dev-dependencies]
[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
Execute
cat a/b/pyproject.toml
[tool.poetry]
name = "b"
version = "0.1.0"
description = ""
authors = ["Your Name <you@example.com>"]
[tool.poetry.dependencies]
python = "^3.8"
c = {path="c"}
[tool.poetry.dev-dependencies]
[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
Execute
cat a/b/c/pyproject.toml
[tool.poetry]
name = "c"
version = "0.1.0"
description = ""
authors = ["Your Name <you@example.com>"]
[tool.poetry.dependencies]
python = "^3.8"
[tool.poetry.dev-dependencies]
[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
In project structure like this, execute poetry install -vvv
will fail, and it’s output below
Execute
poetry install -vvv
Using virtualenv: /Users/linw1995/Library/Caches/pypoetry/virtualenvs/a-lL1Z62BU-py3.8
Updating dependencies
Resolving dependencies...
1: fact: a is 0.1.0
1: derived: a
1: fact: a depends on b (*)
1: selecting a (0.1.0)
1: derived: b (*)
1: fact: b (0.1.0) depends on c (*)
1: selecting b (0.1.0 b)
1: derived: c (*)
1: selecting c (0.1.0 b/c)
1: Version solving took 0.057 seconds.
1: Tried 1 solutions.
Writing lock file
Package operations: 2 installs, 0 updates, 0 removals
- Installing c (0.1.0 b/c)
[EnvCommandError]
Command ['/Users/linw1995/Library/Caches/pypoetry/virtualenvs/a-lL1Z62BU-py3.8/bin/pip', 'install', '--no-deps', '-U', '-e', '/Users/linw1995/a/b/b/c'] errored with the following return code 1, and output:
ERROR: /Users/linw1995/a/b/b/c is not a valid editable requirement. It should either be a path to a local project or a VCS URL (beginning with svn+, git+, hg+, or bzr+).
WARNING: You are using pip version 19.2.3, however version 19.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Traceback (most recent call last):
File "/Users/linw1995/.pyenv/versions/3.8.0/Python.framework/Versions/3.8/lib/python3.8/site-packages/clikit/console_application.py", line 131, in run
status_code = command.handle(parsed_args, io)
File "/Users/linw1995/.pyenv/versions/3.8.0/Python.framework/Versions/3.8/lib/python3.8/site-packages/clikit/api/command/command.py", line 120, in handle
status_code = self._do_handle(args, io)
File "/Users/linw1995/.pyenv/versions/3.8.0/Python.framework/Versions/3.8/lib/python3.8/site-packages/clikit/api/command/command.py", line 171, in _do_handle
return getattr(handler, handler_method)(args, io, self)
File "/Users/linw1995/.pyenv/versions/3.8.0/Python.framework/Versions/3.8/lib/python3.8/site-packages/cleo/commands/command.py", line 92, in wrap_handle
return self.handle()
File "/Users/linw1995/.pyenv/versions/3.8.0/Python.framework/Versions/3.8/lib/python3.8/site-packages/poetry/console/commands/install.py", line 63, in handle
return_code = installer.run()
File "/Users/linw1995/.pyenv/versions/3.8.0/Python.framework/Versions/3.8/lib/python3.8/site-packages/poetry/installation/installer.py", line 74, in run
self._do_install(local_repo)
File "/Users/linw1995/.pyenv/versions/3.8.0/Python.framework/Versions/3.8/lib/python3.8/site-packages/poetry/installation/installer.py", line 286, in _do_install
self._execute(op)
File "/Users/linw1995/.pyenv/versions/3.8.0/Python.framework/Versions/3.8/lib/python3.8/site-packages/poetry/installation/installer.py", line 302, in _execute
getattr(self, "_execute_{}".format(method))(operation)
File "/Users/linw1995/.pyenv/versions/3.8.0/Python.framework/Versions/3.8/lib/python3.8/site-packages/poetry/installation/installer.py", line 327, in _execute_install
self._installer.install(operation.package)
File "/Users/linw1995/.pyenv/versions/3.8.0/Python.framework/Versions/3.8/lib/python3.8/site-packages/poetry/installation/pip_installer.py", line 32, in install
self.install_directory(package)
File "/Users/linw1995/.pyenv/versions/3.8.0/Python.framework/Versions/3.8/lib/python3.8/site-packages/poetry/installation/pip_installer.py", line 221, in install_directory
return self.run(*args)
File "/Users/linw1995/.pyenv/versions/3.8.0/Python.framework/Versions/3.8/lib/python3.8/site-packages/poetry/installation/pip_installer.py", line 118, in run
return self._env.run_pip(*args, **kwargs)
File "/Users/linw1995/.pyenv/versions/3.8.0/Python.framework/Versions/3.8/lib/python3.8/site-packages/poetry/utils/env.py", line 824, in run_pip
return self._run(cmd, **kwargs)
File "/Users/linw1995/.pyenv/versions/3.8.0/Python.framework/Versions/3.8/lib/python3.8/site-packages/poetry/utils/env.py", line 1052, in _run
return super(VirtualEnv, self)._run(cmd, **kwargs)
File "/Users/linw1995/.pyenv/versions/3.8.0/Python.framework/Versions/3.8/lib/python3.8/site-packages/poetry/utils/env.py", line 856, in _run
raise EnvCommandError(e, input=input_)
By installing in more than two nested subprojects, the second subprojects’ req
value went wrong.
package.root_dir='a/b'
is the directory of package b, package.source_url='b/c'
is the relative path from package a to package c. This line of code gets a/b/b/c
by joining this two values.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Gradle add nested subproject from a multi-module project as ...
By default modules of my submodule use settings.gradle, build.gradle of parent project, but not the same files of submodel root project. Is there...
Read more >Declaring Dependencies between Subprojects
We have the projects shared , api and person-service . The person-service project has a dependency on the other two projects. The api...
Read more >Subgroups - GitLab Docs
To override a user's role on an ancestor group, add the user to the subgroup again with a higher role. For example: If...
Read more >Plans within plans: master projects and subprojects
You can have more control over your project by creating smaller projects in ... When you insert a subproject into the master project,...
Read more >Subprojects - The Meson Build system
All subprojects must be inside subprojects directory. The subprojects directory must be at the top level of your project. Subproject declaration must be...
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 FreeTop 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
Top GitHub Comments
I am wishing a nested project structure could be supported to help centralize tool configuration in a monorepo containing multiple Python packages while still supporting being able to publish each package individually to a pypi server.
E.g. I am working on a project with the following structure, where
project-package
,support-package-1
, andsupport-package-2
are all poetry-managed Python packages:The dependency hierarchy I would like to have in this setup is that
root-package
depends onsupport-package-1
, andsupport-package-1
depends onsupport-package-2
. However, this doesn’t seem to be possible today with poetry 1.0.9 on Windows 10. I get the following error when trying to runpoetry update
from the root ofroot-package
with that dependency hierarchy encoded in thepyproject.toml
files:For now I am working around this limitation by explicitly adding both
support-package-1
andsupport-package-2
to the list of dependencies inroot-package
’spyproject.toml
file. That seems to makepoetry update
happy. But this is technically unnecessary since the knowledge thatsupport-package-1
depends onsupport-package-2
is already encoded insupport-package-1
’spyproject.toml
file.As an example for what I mean by “centralize tool configuration”, I have written the
mypy.ini
file in the root of theroot-package
directory to enable easily type-checking all of these nested packages by runningpoetry run mypy
from the root ofroot-package
:Recently I found out that Poetry version 1.1.2 fixes this issue. Thanks to the effort that all contributors made.