Skip to content

solver: fix KeyError due to orphan decisions - root cause - #11009

Draft
radoering wants to merge 3 commits into
python-poetry:mainfrom
radoering:fix-local-version-keyerror-2
Draft

solver: fix KeyError due to orphan decisions - root cause#11009
radoering wants to merge 3 commits into
python-poetry:mainfrom
radoering:fix-local-version-keyerror-2

Conversation

@radoering

Copy link
Copy Markdown
Member

Alternative to #11008 that fixes the root cause instead of the symptom - however too slow (and more risky).

To avoid orphan decisions we have to exclude local versions from the dependency constraint of the first term of the incompatibility. Since we have no means to express such a constraint, we determine all available local versions and build the difference of the public version with them.

This solution has a notable performance issue - it queries the index for all (local) versions of each chosen package version. Actually, we would need a constraint to exclude all local versions to build the term of the incompatibility (similar to arbitrary equality ===). I gave this a quick try, but this resulted in a hanging resolver - either due to bugs in my arbitrary equality implementation or because the solver is not prepared for arbitrary equality - I did not investigate further.

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 test) but not the root cause.
To avoid orphan decisions we have to exclude local versions from the dependency constraint of the first term of the incompatibility. Since we have no means to express such a constraint, we determine all available local version and build the difference of the public version with them.
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