Skip to content

feat: add lowest and lowest-direct resolution strategies - #11095

Draft
Victor-Su-Ortiz wants to merge 1 commit into
python-poetry:mainfrom
Victor-Su-Ortiz:eval/lowest-resolution-strategies-20260924
Draft

Victor-Su-Ortiz wants to merge 1 commit into
python-poetry:mainfrom
Victor-Su-Ortiz:eval/lowest-resolution-strategies-20260924

Conversation

@Victor-Su-Ortiz

Copy link
Copy Markdown

Summary

Adds --resolution-strategy with highest (the existing default), lowest, and lowest-direct, using the normal poetry.lock and environment workflow. Related to #3527.

lowest prefers low compatible versions throughout the graph. lowest-direct prefers low root dependencies while keeping the existing preference for transitive dependencies. These are preferences subject to the complete constraints and existing prerelease/yanked behavior, not a guarantee that every package reaches an independent minimum.

Existing locks remain authoritative unless --regenerate is supplied. The option is also exposed for install/sync when a lock must be created. Invalid values are rejected. Includes CLI documentation and offline tests for strategy selection, constraints/backtracking, extras, Python compatibility, prereleases, lock retention/regeneration and deterministic locking.

Validation

  • Independent related solver/provider/lock/install/installer suite: 816 passed, 2 expected xfails.
  • Related model-run suite including sync: 896 passed, 1 skipped, 2 expected xfails.
  • Configured pre-commit hooks passed for all changed files.
  • ruff format --check src tests, ruff check src tests, and mypy src tests passed.
  • Independent actual CLI integration used a local wheel index to generate and install all three strategies, verified selected installed versions, repeated byte-identical locks, and a constraint that overrides the preferred low version.
  • Full suite: 3318 passed, 33 skipped, 2 expected xfails, 1 setup error. The self-update fixture FileExistsError also reproduces on an unchanged baseline; unrelated self-update code was left intact.

This is an AI-assisted implementation with independent review and testing. Submitted as a draft for review of the CLI/API design and compatibility; it has not been merged or released.

Pull Request Check List

Related: #3527

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

This branch has not been deployed

No deployments
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.

1 participant