Modernize packaging and development tooling with uv and Ruff - #204
Modernize packaging and development tooling with uv and Ruff#204gorewilliams wants to merge 3 commits into
Conversation
sigmavirus24
left a comment
There was a problem hiding this comment.
Clearly ruff is not a drop-in replacement at all. And it looks like it's modifying some fairly deliberate styles.
There's significant churn to "modernize" things. Also seems unlikely that the news fragments you added are of any real value (aside from python support removal) to users. ruff and uv are development only so thusly unimportant for end users.
| c.receive_data( | ||
| b"POST / HTTP/1.1\r\n" | ||
| b"Host: example.com\r\n" | ||
| b"Transfer-Encoding: chunked\r\n\r\n" | ||
| b"POST / HTTP/1.1\r\nHost: example.com\r\nTransfer-Encoding: chunked\r\n\r\n" |
There was a problem hiding this comment.
fyi this is tracked in astral-sh/ruff#18436 and the general suggestion is to use explicit string concatenation (e.g., with +) rather than implicit, but perhaps we'll add a setting 🤷♀️
There was a problem hiding this comment.
(I don't really condone external contributors migrating repositories to our tooling, I just happen to watch this repository because I work on the HTTP stack and figured I'd look at that was objectionable here to get a sense for where our tools aren't doing the right thing)
There was a problem hiding this comment.
Np, appreciate it! Thx for bringing the issue to my attention.
| from typing import List, Type, Union, ValuesView, cast | ||
|
|
||
| from .._connection import Connection, NEED_DATA, PAUSED | ||
| from .._connection import NEED_DATA, PAUSED, Connection |
There was a problem hiding this comment.
I agree with Zanie's comment and am not trying to push this PR forward necessarily, but if you would like to adopt Ruff's isort implementation, you may want to check out the order-by-type and case-sensitive settings, which I think could avoid these changes.
That looks like the main source of churn to me besides the implicit concatenation changes.
|
@sigmavirus24 thx for the review. You're right, ruff isn't a drop-in currently. I think I'll drop it unless you say otherwise (see @zanieb's and @ntBre's comments). Other than that and the news fragments which I'll drop as well, anything else? |
h11's packaging and development configuration was spread across
setup.py,tox.ini, and requirements files, with outdated Python support declarations. This PR follows h2's approach by consolidating metadata and tool configuration inpyproject.tomland using uv with a committed lockfile for development and CI.Validation: all 78 tests pass on each of the seven interpreters; Ruff, mypy, the strict Sphinx build, and wheel/sdist metadata and contents checks pass. A parallel tox run hit a coverage-file collision on Python 3.13; that environment passed when rerun separately.
Closes #203