Skip to content

Unable to updateany package to latest version because wronlgy inferred dependency  #4700

@provinzkraut

Description

@provinzkraut
  • 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).

Issue

Trying to update any package with poetry add <package>@latest results in a SolverProblemError because poetry (wronlgy) assumes that the project depends on both the current and the version it's trying to install.

  SolverProblemError

  Because poetry-test depends on both cryptography (^3.4.7) and cryptography (^35.0.0), version solving failed.

  at ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/puzzle/solver.py:146 in _solve
      142│             packages = result.packages
      143│         except OverrideNeeded as e:
      144│             return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest)
      145│         except SolveFailure as e:
    → 146│             raise SolverProblemError(e)
      147│ 
      148│         # NOTE passing explicit empty array for seen to reset between invocations during update + install cycle
      149│         results = dict(
      150│             depth_first_search(

How to reproduce

  • Set up a new project with the provided pyproject.toml file
  • Run poetry install
  • Run poetry add cryptography@latest

Workaround

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions