Investigate replacing pyupgrade
, black
, isort
and flake8
with ruff
#17570
Labels
developer experience
Anything that improves the experience for Warehouse devs
testing
Test infrastructure and individual tests
Since I couldn't find any discussion about
ruff
in existing issues, I'm opening this one to see if there's interest and to document what I've found so far.Currently, Python linting and formatting (via
make lint
andmake reformat
) is done viablack
,isort
,pyupgrade
andflake8
.ruff
can be used as an (almost) drop-in replacement for most of these. The only thing not supported is customflake8
plugins, like the one defined here.I have a branch where I tested the migration by:
pyupgrade
withruff
's pyupgrade rulesisort
withruff'
's isort rulesblack
withruff format
flake8
's default rules withruff check
flake8-pytest-style
default rules withruff
's flake8-pytest-style rulesflake8
, but only selecting the customWH
plugin mentioned above.After migrating, running with a warm cache I get around a 10 second improvement in both
make
commands, andmake reformat
is now almost instant:cc @miketheman @woodruffw
The text was updated successfully, but these errors were encountered: