Skip to content

[pip-compile] Upgrading a dependency with -P that has extras fails with backtracking resolver #1806

@nwalsh1995

Description

@nwalsh1995

Environment Versions

  1. Python version: 3.7.5
  2. pip version: 23.0
  3. pip-tools version: 6.12.2

Steps to replicate

  1. Create requirements.in file.
# requirements.in
googleapis-common-protos[grpc]==1.56.4
google-api-core[grpc]==1.32.0
  1. Attempt upgrading googleapis-common-protos[grpc] with -P and the backtracking resolver
pip-compile -v --resolver backtracking -P googleapis-common-protos\[grpc\] requirements.in

Expected result

pip-compile upgrades googleapis-common-protos\[grpc\] and extra packages.

Actual result

pip._internal.exceptions.InstallationError: Constraints cannot have extras

Note: without --resolver backtracking the call succeeds after multiple rounds.

pip-compile -v -P googleapis-common-protos\[grpc\] requirements.in

Edit: the command also doesn't work with --strip-extras:

$ pip-compile -v --strip-extras --resolver=backtracking -P googleapis-common-protos\[grpc\] requirements.in

pip._internal.exceptions.InstallationError: Constraints cannot have extras

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is not working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions