Skip to content

Upgrade to Poetry 2.2.1, PEP 621, and Python >=3.10#459

Open
sandhose wants to merge 2 commits intomainfrom
quenting/modern-tooling/python-3.10
Open

Upgrade to Poetry 2.2.1, PEP 621, and Python >=3.10#459
sandhose wants to merge 2 commits intomainfrom
quenting/modern-tooling/python-3.10

Conversation

@sandhose
Copy link
Copy Markdown
Member

@sandhose sandhose commented Apr 3, 2026

Summary

  • Migrate pyproject.toml from [tool.poetry] to PEP 621 [project] table
  • Move dev dependencies to [dependency-groups] (PEP 735)
  • Bump minimum Python from 3.8 to 3.10 (3.8 and 3.9 are EOL)
  • Upgrade CI Poetry action from v1 to v2 (Poetry 2.2.1, supports PEP 621)
  • Update Dockerfile POETRY_VERSION to 2.2.1 and use poetry-plugin-export
  • Update olddeps CI job to test on Python 3.10; fix sed to skip requires-python
  • Retain [tool.poetry] packages for poetry-core module discovery
  • Reorder [tool.ruff] before [tool.isort] to reduce churn in later PRs

Known limitations

  • requires-python = ">=3.10,<4" includes <4 upper bound to satisfy google-auth-stubs Poetry resolution. Unusual but harmless.
  • The sdist include = [{ path = "tests", format = "sdist" }] from the old config is dropped — tests are no longer bundled in the sdist.

Test plan

  • CI green: linting, type checking, unit tests, olddeps (Python 3.10), Docker build
  • poetry install works with Poetry 2.2.1

Part 0 of 7 in the repository modernisation series. All other PRs build on this.

@sandhose sandhose requested a review from a team as a code owner April 3, 2026 11:55
@sandhose sandhose marked this pull request as draft April 3, 2026 12:07
@sandhose sandhose force-pushed the quenting/modern-tooling/python-3.10 branch 2 times, most recently from 09888d8 to 0a6e24f Compare April 3, 2026 13:19
@sandhose sandhose changed the title Require Python 3.10 or newer Upgrade to Poetry 2.2.1, PEP 621, and Python >=3.10 Apr 3, 2026
@sandhose sandhose force-pushed the quenting/modern-tooling/python-3.10 branch 3 times, most recently from 1215718 to 2ad3c6f Compare April 3, 2026 13:49
sandhose added 2 commits April 3, 2026 16:01
- Migrate pyproject.toml from [tool.poetry] to PEP 621 [project] table
- Move dev dependencies to [dependency-groups] (PEP 735)
- Bump minimum Python from 3.8 to 3.10 (3.8 and 3.9 are EOL)
- Upgrade Poetry in CI from 1.2.2 to 2.2.1
- Update olddeps CI job to test on Python 3.10
- Fix sed in olddeps to skip requires-python line
- Regenerate poetry.lock with Poetry 2.2.1
@sandhose sandhose mentioned this pull request Apr 3, 2026
3 tasks
@sandhose sandhose force-pushed the quenting/modern-tooling/python-3.10 branch from 2ad3c6f to 21c4d93 Compare April 3, 2026 14:10
@sandhose sandhose marked this pull request as ready for review April 3, 2026 14:47
Copy link
Copy Markdown
Contributor

@reivilibre reivilibre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise fine I think

python-version: "3.10"
- name: Patch pyproject.toml to require oldest dependencies
run: |
# Ugly. Could use something like https://pyproject-parser.readthedocs.io/en/latest/cli.html#info in the future.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think comment should still apply

run: |
# Ugly. Could use something like https://pyproject-parser.readthedocs.io/en/latest/cli.html#info in the future.
sed --in-place=.bak -e 's/>=/==/g' pyproject.toml
diff pyproject.toml.bak pyproject.toml || true # diff returns 1 if there is a change
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this comment should also stay

ARG POETRY_VERSION
RUN --mount=type=cache,target=/root/.cache/uv \
if [ -z "$TEST_ONLY_IGNORE_POETRY_LOCKFILE" ]; then \
uvx --with poetry-plugin-export==1.8.0 \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should stay pinned to a known-good version, it was like that for a reason iirc

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.

2 participants