diff --git a/src/poetry/packages/locker.py b/src/poetry/packages/locker.py index e57e60b83b7..2cc52ac9400 100644 --- a/src/poetry/packages/locker.py +++ b/src/poetry/packages/locker.py @@ -274,8 +274,9 @@ def __walk_dependencies( requirement.set_constraint(constraint) for require in locked_package.requires: - if require.in_extras and locked_package.features.isdisjoint( - require.in_extras + if require.is_optional() and not any( + require in locked_package.extras[feature] + for feature in locked_package.features ): continue