Skip to content

AVRO-4232: [Python] Backport uv/ruff tooling to branch-1.12 - #3922

Merged
RyanSkraba merged 2 commits into
apache:branch-1.12from
iemejia:AVRO-4232-branch-1.12-uv-backport
Aug 6, 2026
Merged

AVRO-4232: [Python] Backport uv/ruff tooling to branch-1.12#3922
RyanSkraba merged 2 commits into
apache:branch-1.12from
iemejia:AVRO-4232-branch-1.12-uv-backport

Conversation

@iemejia

@iemejia iemejia commented Aug 6, 2026

Copy link
Copy Markdown
Member

What

Backports the Python tooling modernization from AVRO-4232 (#3658) to branch-1.12.

Why

The Java interop workflow (test-lang-java.yml) on branch-1.12 runs uv sync --frozen in lang/py, but that workflow change was previously backported without the accompanying lang/py migration. There was no uv.lock and no [project] table in pyproject.toml, so uv sync --frozen failed immediately and the workflow was red.

Changes

  • Migrate lang/py from tox/setuptools to uv + ruff
  • Add lang/py/uv.lock and [project] / [dependency-groups] to pyproject.toml
  • Remove tox.ini and setup.cfg
  • Update build.sh (ruff / coverage / mypy targets)
  • Convert test-lang-py.yml to uv (drops Python 3.9 from CI, adds 3.14 — matches main)
  • Exclude lang/py/uv.lock from the RAT license check (pom.xml)

branch-1.12 specifics

  • pyproject.toml version pinned to 1.12.2 (matches share/VERSION.txt)
  • [tool.setuptools.packages.find] include = ["avro*"] to fix flat-layout "multiple top-level packages" discovery error

Verification (local)

  • uv sync --frozen
  • ruff check / ruff format --diff
  • mypy avro/ — no issues ✅
  • ./build.sh coverage — 561 tests pass (1 skipped) ✅
  • ./build.sh interop-data-generate — produces null/deflate/bzip2/snappy/zstandard variants ✅

Note

This drops Python 3.9 from CI (requires-python = ">=3.10"), consistent with main.

Backports the Python tooling modernization (AVRO-4232, apache#3658) so that the
Java interop workflow's 'uv sync --frozen' step works on branch-1.12.

The workflow change was previously backported without the accompanying
lang/py migration, leaving no uv.lock or [project] table, which caused
'uv sync --frozen' to fail.

- Migrate lang/py from tox/setuptools to uv + ruff
- Add uv.lock and [project]/[dependency-groups] to pyproject.toml
- Remove tox.ini and setup.cfg
- Update build.sh (ruff/coverage/mypy targets)
- Convert test-lang-py.yml to uv (drops py3.9 CI, adds 3.14)
- Exclude lang/py/uv.lock from RAT license check

Version pinned to 1.12.2 and packages.find restricted to avro* to fix
flat-layout package discovery.
uvx fetches the latest ruff, whose stricter default lint rules flag 252
pre-existing issues in the (not-yet-modernized) branch-1.12 source. Use
'uv run ruff' to run the version pinned in uv.lock (0.15.1), matching
main and keeping lint reproducible.
@github-actions github-actions Bot added the Java Pull Requests for Java binding label Aug 6, 2026
@iemejia
iemejia force-pushed the AVRO-4232-branch-1.12-uv-backport branch from 6532a88 to ec78070 Compare August 6, 2026 12:19
@github-actions github-actions Bot removed the Java Pull Requests for Java binding label Aug 6, 2026
@RyanSkraba
RyanSkraba merged commit ed2ee6a into apache:branch-1.12 Aug 6, 2026
44 of 46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants