AVRO-4232: [Python] Modernize the Python tooling#3658
AVRO-4232: [Python] Modernize the Python tooling#3658
Conversation
Use `uv` for management and `ruff` for linting and formatting
027ddcf to
6ec71fe
Compare
|
|
||
| def main(): | ||
| mail_server = http_server.HTTPServer(SERVER_ADDRESS, MailHandler) | ||
| mail_server = http.server.HTTPServer(SERVER_ADDRESS, MailHandler) |
There was a problem hiding this comment.
I have no idea how this worked before
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Here for some reason there was a problem with l, so I renamed it to last
| @@ -1,84 +0,0 @@ | |||
| ## | |||
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
It seems I have "translated" correctly most of the setuptools data (setup.cfg) to pyproject.toml (PEP 621).
My only uncertainty is package-data.
|
@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 :-) |
|
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 |
Policy by Infra: https://infra.apache.org/github-actions-policy.html > External actions Last allowed version: 7.1.6 (https://github.com/apache/infrastructure-actions/blob/2943971f47fadefa6d86af85c2c24c2cee262ee1/actions.yml#L25-L26) Co-authored-by: Ryan Skraba <ryan@skraba.com>
What is the purpose of the change
Use
uvfor management andrufffor linting and formattingVerifying 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
build.sh