Conversation

gvwilson
  • Remove requires-optional.txt and test_requirements/* (no longer used).
  • Convert commands.py to use argparse instead of hand-rolled.
  • Rationalize imports in codegen/__init__.py (all at top level).
  • Update "dev" section of pyproject.toml to use ruff instead of black.
  • Update pyproject.toml to install inflect and requests.
  • Modify uv.lock file.
  • Modify code reformatting in codegen/__init__.py to use ruff instead of black.
  • Add new function to use ruff to reformat existing code (run python commands.py format).
  • Add new function to use ruff to check code (run python 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 .

@gvwilsongvwilson requested a review from emilykl June 5, 2025 13:48
@emilykl

@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 on main.

  • The CONTRIBUTING.md needs to be updated to remove references to requires-optional.txt, and it needs some general updates as well. I'd be happy to work on that.

  • Could we add the uv.lock in a separate PR? I'm not opposed, but CONTRIBUTING.md needs to be updated to explain how to use the lockfile in development, otherwise things will get messy.

@gvwilsongvwilson force-pushed the switch-to-ruff branch 4 times, most recently from af41d30 to 9c60129 Compare June 6, 2025 16:23
@rl-utility-man

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.

@gvwilsongvwilson self-assigned this Jun 10, 2025
@gvwilsongvwilson added the featuresomething newlabel Jun 10, 2025
@gvwilson

@emilykl clean build - I've put anywidget in dev_core because core tests require it. Let me know what you think?

- Run `ruff format --check .` instead of `ruff format .` in Circle CI.
- Use `base_type is list` instead of `base_type == list`.
- Remove commented-out lines of code.
- Remove unnecessary parentheses around some strings.
- Be more consistent about (re-)naming test functions that had duplicated names.
- Use `noqa: F401` to suppress `ruff check` complaint about unused import.

Choose a reason for hiding this comment

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

Woohoo! 🚀

@gvwilsongvwilson merged commit fbb65c8 into main Jun 19, 2025
10 checks passed
Sign up for free to join this conversation on . Already have an account? Sign in to comment
featuresomething newP1needed for current cycle
None yet

Successfully merging this pull request may close these issues.