Skip to content

Switch from yapf/pylint/isort to ruff #874

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

Draft
wants to merge 7 commits into
base: dev
Choose a base branch
from

Conversation

fsschneider
Copy link
Contributor

This PR updates our codebase to use ruff for linting and formatting, replacing yapf, pylint, and isort. ruff offers the combined functionality of all three tools while being significantly faster.

Previously, running yapf, pylint, and isort locally took ~1m 16s on my workstation.

pylint algoperf && pylint reference_algorithms && pylint prize_qualification_baselines && pylint submission_runner.py && pylint tests && isort . --check --diff && yapf . --diff --recursive

In contrast, running ruff took ~0.14s on my workstation.

ruff check && ruff format --check  

In GitHub Actions, the improvement is less dramatic due to tool installation times, but I observed roughly a 50% reduction in runtime.

Todo

  • Ensure that the code conforms to the ruff code style. Due to slight differences in the code style of ruff and our previous setup, the current checks fail. I will update this PR to include modifying the existing code to conform with the new ruff style.

Copy link

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

@fsschneider fsschneider self-assigned this Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant