Skip to content

AVRO-4232: [Python] Modernize the Python tooling#3658

Open
martin-g wants to merge 23 commits intomainfrom
avro-4232-use-uv-ruff
Open

AVRO-4232: [Python] Modernize the Python tooling#3658
martin-g wants to merge 23 commits intomainfrom
avro-4232-use-uv-ruff

Conversation

@martin-g
Copy link
Member

What is the purpose of the change

Use uv for management and ruff for linting and formatting

Verifying this change

This is mostly changes in Python package management (pyproject.toml and tox.ini)
The Python source files have small modifications caused by linting/formatting issues

Documentation

  • Does this pull request introduce a new feature? no
  • If yes, how is the feature documented? See build.sh

Use `uv` for management and `ruff` for linting and formatting
@martin-g martin-g force-pushed the avro-4232-use-uv-ruff branch from 027ddcf to 6ec71fe Compare February 18, 2026 13:26

def main():
mail_server = http_server.HTTPServer(SERVER_ADDRESS, MailHandler)
mail_server = http.server.HTTPServer(SERVER_ADDRESS, MailHandler)
Copy link
Member Author

Choose a reason for hiding this comment

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

I have no idea how this worked before

Copy link
Contributor

Choose a reason for hiding this comment

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

Probably didn't. Is there evidence it was ever covered?



def looney_records():
return ({"first": f, "last": l, "type": t} for f, l, t in LOONIES)
Copy link
Member Author

Choose a reason for hiding this comment

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

Here for some reason there was a problem with l, so I renamed it to last

@martin-g martin-g requested a review from kojiromike February 18, 2026 13:50
@@ -1,84 +0,0 @@
##
Copy link
Member Author

Choose a reason for hiding this comment

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

I am not sure whether this file should be removed.
But before removing it uv sync would fail with error like There is no "get" in NoneType or something like that.

Copy link
Contributor

Choose a reason for hiding this comment

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

It should be fine to remove this as long as the PEP 621 requirements are met. I haven't used uv that much (currently working in a php ecosystem), but I believe uv is fully compliant with that PEP.

Copy link
Member Author

Choose a reason for hiding this comment

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

It seems I have "translated" correctly most of the setuptools data (setup.cfg) to pyproject.toml (PEP 621).
My only uncertainty is package-data.

@martin-g
Copy link
Member Author

@kojiromike I have some concerns about the removal of setup.cfg. I am not a Python dev and I am not fully confident in what I am doing here :-)
I'd be really thankful if you can test the dist target (uv run ./build.sh dist) and verify that things look good in the sdist and wheel packages.

@martin-g
Copy link
Member Author

My main reason to introduce uv here is because the Python build started failing again without any changes in lang/py/. I guess some dependency has released a new version and to due not using a .lock file the build became unstable.

https://github.com/apache/avro/actions/runs/22087958485/job/63826627519

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.

3 participants

Comments