python-poetry / python-poetry/poetry

Remove upper bound checking on Python version

Open
#10,136 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Issue Kind

Change in current behaviour

Description

Remove upper bound checking on the requires-python and python version specifier for a Poetry project. There is a lot of practical experience that shows upper bounds on Python versions can lead to difficult situations when managing Python dependencies. This thread has a good discussion about them:

One practical one that comes up is how Poetry's upper bounds on the Python version becomes "viral". If I depend on a package with an upper bound on the Python version, then I must also add that upper bound to my package or else Poetry won't resolve it (falling back potentially to an old version of the dependency otherwise). This then can trigger other packages using Poetry and so on.

Edit: The issue above can be solved in Poetry 2: https://python-poetry.org/docs/pyproject/#requires-python

uv has already removed requires-python upper bound checking:

Poetry took a small step toward this as well

I'd propose that it would be a net benefit to follow uv's position here in Poetry as well.

Impact

Users relying on upper bounds of Python version could be impacted. Since Python 4.0 is no where in planning (may never happen) the old default Poetry packages that add this likely had little actual effect/meaning.

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 tracing Poetry’s handling of the requires-python and python version specifiers during dependency resolution, then read the linked uv and Poetry pull requests for the intended behavior. Done means upper bounds are no longer enforced while the impact on users relying on them is covered by appropriate tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.