Skip to content

fix(ci): replace poetry with uv to fix python 3.8 builds - #32

Merged
hvalev merged 1 commit into
mainfrom
fix/uv-migration
Oct 17, 2026
Merged

hvalev merged 1 commit into
mainfrom
fix/uv-migration

Conversation

@hvalev

@hvalev hvalev commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

Why

CI has been red on every branch since June, including main (e52fef1): the Test with different Python versions (3.8) job fails at step 6, "Install dependencies" (poetry install, exit 1). This is what makes #30 and #31 show up as unstable — their bumps are correct, they just inherit the broken leg.

Root cause: sudo apt install pipx installs pipx against the runner's system Python, so pipx install poetry resolves the newest Poetry that pipx's interpreter accepts — currently Poetry 2.5.1, which requires >=3.10. Steps 1-5 stay green on the 3.8 leg, then Poetry 2.x cannot seed a 3.8 virtualenv:

the bundled seeder no longer ships pip/setuptools for Python 3.8; the oldest
supported target is Python 3.9 - pass --no-seed for an empty environment, use a
seeder that provides Python 3.8 wheels, or install an older virtualenv release

Reproduced locally: Poetry 1.8.5 under real 3.8 installs fine, Poetry 2.5.1 targeting a 3.8 env exits 1. So the matrix is not the problem - the toolchain above it is.

What

Switch the toolchain to uv. uv manages its own interpreters and still creates 3.8 environments, so the matrix keeps 3.8 and actions/setup-python disappears entirely.

  • pyproject.toml: PEP 621 metadata + uv_build (module-root = "" for the flat layout); dev deps move to [dependency-groups] with the same ranges as the old ^0.9 / ^8.0 / ^5.0
  • uv.lock replaces poetry.lock; CI runs uv sync --frozen + uv run ruff/pytest
  • publish via uv build + pypa/gh-action-pypi-publish, reusing the existing PYPI_PASSWORD secret
  • ubuntu-22.04 -> ubuntu-24.04, pinned rather than ubuntu-latest: the latest label starts migrating to Ubuntu 26.04 on 19 Oct 2026 ([Ubuntu] ubuntu-latest label will use Ubuntu 26.04 in November 2026 actions/runner-images#14748). uv supplies the interpreters, so the newer image no longer costs us 3.8
  • strategy.fail-fast: false, so one red leg no longer cancels its siblings
  • coverage/Codecov now runs before publishing

Verification

uv sync --frozen + ruff check . + pytest locally on 3.8, 3.9, 3.10, 3.11, 3.12, 3.13 - all green (18 tests).

Artifacts match the old build: py_markdown_table-1.3.0-py3-none-any.whl and .tar.gz, wheel ships only py_markdown_table/ (tests excluded, as in #11), License-Expression: MIT, LICENSE included in both.

Two judgement calls, one line each to revert: the deprecated License :: OSI Approved :: MIT License classifier is dropped in favour of license/license-files (PEP 639), and the coverage step moved ahead of the publish step.


Note: astral-sh/setup-uv publishes point tags only (no floating v10), so the action is pinned to v10.3.0.

Poetry 2.x can no longer seed a Python 3.8 virtualenv. `pipx install
poetry` resolves against the runner's system interpreter, so CI gets
Poetry 2.5.1 (requires >=3.10) on every matrix leg; its bundled
virtualenv seeder no longer ships pip/setuptools wheels for 3.8 and
`poetry install` exits 1 in the 3.8 leg on all branches.

uv manages interpreters itself, so it can create 3.8 environments and
setup-python is no longer needed:

- pyproject.toml: PEP 621 metadata, uv_build backend, flat module layout
- uv.lock replaces poetry.lock, CI runs `uv sync --frozen`
- publish via `uv build` and pypa/gh-action-pypi-publish
- run coverage before publishing, disable strategy fail-fast
@hvalev
hvalev merged commit 536098d into main Oct 17, 2026
12 checks passed
@hvalev
hvalev deleted the fix/uv-migration branch October 17, 2026 20:30
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.

1 participant