python-poetry / python-poetry/poetry

Support lock dependencies with lowest solvable versions

Open
#3,527 33 comments 60 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/feature status/needs-consensus status/triage
Dominant language
Python
Stars
34.3k
Forks
2.5k
Avg merge
2d 19h
Merged PRs (30d)
30

Description

  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.

Feature Request

Context

When I am implementing a library, it would be super useful to run my tests with all the supported dependencies defined with the constrains in pyproject.toml. This will prevent errors in production when, for example, I use some new features of a dependency and forget to update the dependencies constrains (this is hard to identify when you are coding).

Because running the tests with all the possible combinations of all your supported libraries is virtually impossible, maybe running them with the lowest versions solvable solution and also the highest (I think this is the default behavior)

Proposal
  • add the flag --use-lowest-versions to the cli entrypoints (install, sync, lock, shell, and run)
  • these commands will create and/or use a different lock file poetry.lowest.lock
  • a different venv will be created by just adding lowest after the project name like this: {project_name}-lowest-{id}-{python-version}
Main simple use case

In ci do the following steps

  • Install environments
>>> poetry install 
>>> poetry install --use-lowest-versions
  • run tests for highest versions
poetry run pytest  --junit-xml pytest.xml
  • run tests for lowest versions
poetry run --use-lowest-versions pytest  --junit-xml pytest.xml

Note: I would appreciate if anyone has a better name for the flag (naming is the hardest part :P)

Also, I looked a the code and I think I know where add this logic, I can create a PR if you like the idea

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the CLI entrypoints named in the proposal—install, sync, lock, shell, and run—alongside the existing lock-file and virtual-environment behavior. Done means supporting a lowest-solvable dependency mode with a separate lock file and environment, plus the documented CI commands working for both highest and lowest versions.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.