switch to ruff
- Remove
requires-optional.txtandtest_requirements/*(no longer used). - Convert
commands.pyto useargparseinstead of hand-rolled. - Rationalize imports in
codegen/__init__.py(all at top level). - Update
"dev"section ofpyproject.tomlto useruffinstead ofblack. - Update
pyproject.tomlto installinflectandrequests. - Modify
uv.lockfile. - Modify code reformatting in
codegen/__init__.pyto useruffinstead ofblack. - Add new function to use
ruffto reformat existing code (runpython commands.py format). - Add new function to use
ruffto check code (runpython commands.py lint). - Regenerate and reformat code.
This PR has been rebuilt on top of #5214 to include recent changes to validator generation.
This PR currently fails the build because Circle CI is expecting requires-optional.txt, which this PR removes.
We need to decide if we're leaving build on Circle CI or moving it to GitHub.
@gvwilson big picture comments --
-
I have a STRONG preference for also committing the
ruff-formatted files as part of this PR. (To avoid cluttering up this PR, the formatting changes themselves could be done on a separate branch which branches off of this one.) But if we don't do the actual formatting step as part of this PR, we'll miss issues and then have to fix them later once this is onmain. -
The
CONTRIBUTING.mdneeds to be updated to remove references torequires-optional.txt, and it needs some general updates as well. I'd be happy to work on that. -
Could we add the
uv.lockin a separate PR? I'm not opposed, butCONTRIBUTING.mdneeds to be updated to explain how to use the lockfile in development, otherwise things will get messy.
What would you think of adding an item to the pull request template documentations section that recommends:
[ ] start Python code blocks with ```python?
It's something that is not obvious in the checklist and that I've forgotten to do a couple times. Forgetting to do so can prevent the example from displaying.
@gvwilson Add this line to the dev_optional extra in pyproject.toml; we had it in test_requirements/requires_optional.txt and I believe it will fix the Python 3.8 failure in the CI.
"fiona<=1.9.6;python_version<='3.8'" # fiona>1.9.6 is not compatible with geopandas<1; geopandas>=1 is not compatible with python 3.8
@gvwilson Are we switching to use the ruff linter in addition to the formatter? We can do that but it's a much bigger change than just using the formatter.
@emilykl clean build - I've put anywidget in dev_core because core tests require it. Let me know what you think?