Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat [WIP]: add strategy=lowest #9631

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

TiansuYu
Copy link

@TiansuYu TiansuYu commented Aug 15, 2024

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 TiansuYu changed the title feat: add strategy=lowest feat [WIP]: add strategy=lowest Aug 15, 2024
@Secrus Secrus marked this pull request as draft August 16, 2024 14:30
@Secrus
Copy link
Member

Secrus commented Aug 16, 2024

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

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.

Support lock dependencies with lowest solvable versions
2 participants