Skip to content

solver: fix KeyError due to orphan decisions - #11008

Draft
radoering wants to merge 1 commit into
python-poetry:mainfrom
radoering:fix-local-version-keyerror
Draft

solver: fix KeyError due to orphan decisions#11008
radoering wants to merge 1 commit into
python-poetry:mainfrom
radoering:fix-local-version-keyerror

Conversation

@radoering

Copy link
Copy Markdown
Member

This only fixes the symptom (in some cases - see xfail tests) but not the root cause.

The issue occurs when two builds share a base version and differ only by a local segment, e.g. torch 2.12.1, which requires triton, and a torch 2.12.1+cpu build, which does not. While backtracking, the solver records the incompatibilities of the 2.12.1 build and then settles on 2.12.1+cpu. Since a local segment is ignored by ==, 2.12.1+cpu satisfies the term torch (==2.12.1), so the discarded build's incompatibilities keep deriving its transitive dependencies, which are left behind as orphan decisions. They must not be carried into the solution.

With this change we just ignore such orphan decisions. However, they can still let the resolution fail if they conflict (or do not exist).

Pull Request Check List

Resolves: #10965

  • Added tests for changed code.
  • Updated documentation for changed code.

This only fixes the symptom (in some cases - see xfail tests) but not the root cause.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Infinite loop on poetry lock with specific dependency update

1 participant