poetry icon indicating copy to clipboard operation
poetry copied to clipboard

feat [WIP]: add strategy=lowest

Open TiansuYu opened this issue 1 year ago • 2 comments

Pull Request Check List

Resolves: #3527

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

My comments

I have tried to follow the suggestion from here to come up with an solution. From what I have observed, it does not result in a resolution using the lowest version, but behaves the same as strategy=highest.

To reproduce, run poetry install then the dev version should be available at .venv/bin/poetry.

Try lock with an experiement project (e.g. with only one dependency, say requests):

.venv/bin/poetry lock --strategy=lowest --directory <some experimental project dir>

Then check what the result is, by poetry show --directory xyz (either using the dev one or a prod one):

certifi            2024.7.4 Python package for providing Mozilla's CA Bundle.
charset-normalizer 3.3.2    The Real First Universal Charset Detector. Open, modern...
idna               3.7      Internationalized Domain Names in Applications (IDNA)
requests           2.32.3   Python HTTP for Humans.
urllib3            2.2.2    HTTP library with thread-safe connection pooling, file ...

That means the native approach does not work. As a next step, I would have a deeper look at version_solver.py to understand if we could change the heuristics on version solving (not sure if I need to fully understand the Pubgrub algo though).

TiansuYu avatar Aug 15 '24 12:08 TiansuYu

Since you marked it as WIP, I converted the PR to draft.

Secrus avatar Aug 16 '24 14:08 Secrus

Currently, I have very limited capacity on this, so dont expect this to be moving forward any time soon.

TiansuYu avatar Oct 18 '24 12:10 TiansuYu

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Mar 30 '25 00:03 github-actions[bot]