Skip to content

Commit 9c5a50d

Browse files
committed
ci: update linting tool from flake8 to Ruff
1 parent 78bfa9e commit 9c5a50d

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

.github/workflows/tests.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,12 @@ jobs:
2727
- name: Install dependencies
2828
run: |
2929
python -m pip install --upgrade pip
30-
python -m pip install flake8
31-
pip install pytest pytest-cov
32-
pip install .
30+
pip install ".[dev]"
3331
34-
- name: Lint with flake8
32+
- name: Lint with Ruff
3533
run: |
36-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
37-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
34+
ruff check .
35+
ruff format --check .
3836
3937
- name: Run tests
4038
run: pytest --cov --cov-branch --cov-report=xml --junitxml=junit.xml

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,7 @@ convention = "google"
6262
dev = [
6363
"black>=26.1.0",
6464
"isort>=7.0.0",
65+
"pytest>=9.0.2",
66+
"pytest-cov>=7.0.0",
6567
"ruff>=0.14.14",
6668
]

tests/test_gpu.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def test_gpu_not_found(self, mock_run: MagicMock, mock_which: MagicMock) -> None
9494
def test_multiple_gpus(self, mock_run: MagicMock, mock_which: MagicMock) -> None:
9595
"""Tests detection of multiple GPUs."""
9696
mock_which.return_value = "nvidia-smi"
97-
output = "0, GPU A, 8000\n" "1, GPU B, 12000"
97+
output = "0, GPU A, 8000\n1, GPU B, 12000"
9898
mock_run.return_value.stdout = output
9999
mock_run.return_value.returncode = 0
100100

0 commit comments

Comments
 (0)