Skip to content

Convert tests to ruff-format #21129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

hmellor
Copy link
Member

@hmellor hmellor commented Jul 17, 2025

RFC: #17657

If we are converting directory x:

  • In x, we add a local pyproject.toml which:
    • overrides ruff's line length to 88 (it's own default)
    • removes the deprecated type ignores
    • enables isort in ruff
    • enables formatting of code in docstrings (good for the API docs)
  • We add x to the list of files to run ruff-format on in .pre-commit-config.yaml
  • We add x to the list of ignores in the yapf and isort config in the root pyproject.toml

Copy link

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

🚀

@mergify mergify bot added deepseek Related to DeepSeek models llama Related to Llama models multi-modality Related to multi-modality (#4194) performance Performance-related issues qwen Related to Qwen models rocm Related to AMD ROCm structured-output speculative-decoding v1 labels Jul 17, 2025
@mergify mergify bot added the tpu Related to Google TPUs label Jul 17, 2025
Copy link

mergify bot commented Jul 17, 2025

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @hmellor.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request successfully converts the tests directory to use ruff-format. The changes are well-contained and achieve the stated goal.

Here's a summary of my review:

  • Configuration: The updates to .pre-commit-config.yaml and pyproject.toml correctly switch the formatting responsibility for the tests directory from yapf and isort to ruff-format. The use of a verbose regex in .pre-commit-config.yaml is a nice improvement for readability.
  • Code Formatting: The changes across all Python files in the tests directory are purely stylistic and consistent with the application of a new code formatter. I've reviewed the diffs and found no unintended logical changes.
  • Correctness: The changes appear correct and align with the RFC. The CI test runs will be the ultimate verification that no regressions were introduced.

Overall, this is a solid refactoring effort that improves tooling and consistency. I have no high or critical issues to report. The PR looks good to merge.

@hmellor hmellor force-pushed the ruff-format-tests branch from cf4d3a8 to 9bd0dea Compare July 17, 2025 16:24
@mergify mergify bot removed the tpu Related to Google TPUs label Jul 17, 2025
hmellor added 2 commits July 17, 2025 17:25
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
@hmellor hmellor force-pushed the ruff-format-tests branch from 9bd0dea to ceb7cc2 Compare July 17, 2025 16:25
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
@mergify mergify bot removed the needs-rebase label Jul 17, 2025
hmellor added 2 commits July 17, 2025 18:06
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
@mergify mergify bot added the tpu Related to Google TPUs label Jul 18, 2025
Copy link

mergify bot commented Jul 18, 2025

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @hmellor.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Jul 18, 2025
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
@mergify mergify bot removed the needs-rebase label Jul 18, 2025
Copy link

mergify bot commented Jul 18, 2025

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @hmellor.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Jul 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deepseek Related to DeepSeek models llama Related to Llama models multi-modality Related to multi-modality (#4194) needs-rebase performance Performance-related issues qwen Related to Qwen models rocm Related to AMD ROCm speculative-decoding structured-output tool-calling tpu Related to Google TPUs v1
Projects
Status: No status
Status: No status
Development

Successfully merging this pull request may close these issues.

1 participant