-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
poetry install
fails when irrelevant extra is not installable
#8548
Comments
not a bug, poetry needs to consider the optional dependencies to be sure that a consistent solution is available |
actually I've changed my mind, this can probably sensibly be addressed with something like: diff --git a/src/poetry/installation/installer.py b/src/poetry/installation/installer.py
index c30dd1b4..98fe4d43 100644
--- a/src/poetry/installation/installer.py
+++ b/src/poetry/installation/installer.py
@@ -332,6 +332,8 @@ class Installer:
# Validate the dependencies
for op in ops:
+ if op.skipped:
+ continue
dep = op.package.to_dependency()
if dep.is_file() or dep.is_directory():
dep = cast("PathDependency", dep) (plus corresponding unit test) or maybe it would be better to use the diff --git a/src/poetry/installation/installer.py b/src/poetry/installation/installer.py
index c30dd1b4..4c8d6bfd 100644
--- a/src/poetry/installation/installer.py
+++ b/src/poetry/installation/installer.py
@@ -335,7 +335,7 @@ class Installer:
dep = op.package.to_dependency()
if dep.is_file() or dep.is_directory():
dep = cast("PathDependency", dep)
- dep.validate(raise_error=True)
+ dep.validate(raise_error=not op.skipped)
# Execute operations
status = self._execute(ops) merge request welcome I expect |
Thanks @dimbleby, I'll make a PR with the suggested changes |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
-vvv
option) and have included the output below.Issue
I have included
agbenchmark
as an optional dependency, which is only installed as part of thebenchmark
extras group if specified. However, runningpoetry install
without--extras benchmark
still fails ifagbenchmark
is not installable, in this case because its source path is not accessible in the docker build context.In my opinion,
poetry install
should ignore non-installable packages when they are optional and not included in the set of packages to be installed.Raw output
The text was updated successfully, but these errors were encountered: