Skip to content

Commit 8f8405c

Browse files
authored
Add format check to quality-check workflow and fix formatting (#1807)
SUMMARY: Seems like we're not currently checking formatting on prs. The `make style` command calls `ruff format` but the `make quality` command never checks the formatting. This pr fixes that and corrects the formatting in `setup.py` --------- Signed-off-by: Fynn Schmitt-Ulms <[email protected]>
1 parent 7391f52 commit 8f8405c

File tree

3 files changed

+10
-41
lines changed

3 files changed

+10
-41
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ endif
2525
quality:
2626
@echo "Running python quality checks";
2727
ruff check $(CHECKDIRS);
28+
ruff format --check $(CHECKDIRS);
2829
isort --check-only $(CHECKDIRS);
2930
flake8 $(CHECKDIRS) --max-line-length 88 --extend-ignore E203,W605;
3031

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ skip = ["src/llmcompressor/transformers/tracing/", "src/llmcompressor/version.py
1414
files = "src/guidellm"
1515

1616
[tool.ruff]
17-
exclude = ["build", "dist", "env", ".venv", "src/llmcompressor/transformers/tracing/"]
17+
exclude = ["build", "dist", "env", ".venv", "src/llmcompressor/transformers/tracing/", "src/llmcompressor/version.py"]
1818
lint.select = ["E", "F", "W"]
1919
lint.extend-ignore = ["E203", "W605"]
2020

setup.py

Lines changed: 8 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -110,63 +110,31 @@ def localversion_func(version: ScmVersion) -> str:
110110
"src", include=["llmcompressor", "llmcompressor.*"], exclude=["*.__pycache__.*"]
111111
),
112112
install_requires=[
113-
(
114-
"loguru>=0.7.2,<=0.7.3"
115-
if BUILD_TYPE == "release"
116-
else "loguru>=0.7.2"
117-
),
118-
(
119-
"pyyaml>=6.0.1,<=6.0.2"
120-
if BUILD_TYPE == "release"
121-
else "pyyaml>=6.0.1"
122-
),
113+
("loguru>=0.7.2,<=0.7.3" if BUILD_TYPE == "release" else "loguru>=0.7.2"),
114+
("pyyaml>=6.0.1,<=6.0.2" if BUILD_TYPE == "release" else "pyyaml>=6.0.1"),
123115
# librosa dependency numba is currently not compatible with numpy>=2.3
124116
# https://numba.readthedocs.io/en/stable/user/installing.html#version-support-information
125-
(
126-
"numpy>=2.0.0,<=2.3.2"
127-
if BUILD_TYPE == "release"
128-
else "numpy>=2.0.0"
129-
),
117+
("numpy>=2.0.0,<=2.3.2" if BUILD_TYPE == "release" else "numpy>=2.0.0"),
130118
(
131119
"requests>=2.32.2,<=2.32.5"
132120
if BUILD_TYPE == "release"
133121
else "requests>=2.32.2"
134122
),
135-
(
136-
"tqdm>=4.66.3,<=4.67.1"
137-
if BUILD_TYPE == "release"
138-
else "tqdm>=4.66.3"
139-
),
140-
(
141-
"torch>=2.7.0,<=2.8.0"
142-
if BUILD_TYPE == "release"
143-
else "torch>=2.7.0"
144-
),
123+
("tqdm>=4.66.3,<=4.67.1" if BUILD_TYPE == "release" else "tqdm>=4.66.3"),
124+
("torch>=2.7.0,<=2.8.0" if BUILD_TYPE == "release" else "torch>=2.7.0"),
145125
(
146126
"transformers>=4.53.0,<=4.55.2"
147127
if BUILD_TYPE == "release"
148128
else "transformers>=4.53.0"
149129
),
150-
(
151-
"datasets>=4.0.0,<=4.0.0"
152-
if BUILD_TYPE == "release"
153-
else "datasets>=4.0.0"
154-
),
130+
("datasets>=4.0.0,<=4.0.0" if BUILD_TYPE == "release" else "datasets>=4.0.0"),
155131
(
156132
"accelerate>=1.6.0,<=1.10.0"
157133
if BUILD_TYPE == "release"
158134
else "accelerate>=1.6.0"
159135
),
160-
(
161-
"pynvml>=11.5.3,<=12.0.0"
162-
if BUILD_TYPE == "release"
163-
else "pynvml>=11.5.3"
164-
),
165-
(
166-
"pillow>=10.4.0,<=10.4.0"
167-
if BUILD_TYPE == "release"
168-
else "pillow>=10.4.0"
169-
),
136+
("pynvml>=11.5.3,<=12.0.0" if BUILD_TYPE == "release" else "pynvml>=11.5.3"),
137+
("pillow>=10.4.0,<=10.4.0" if BUILD_TYPE == "release" else "pillow>=10.4.0"),
170138
(
171139
"compressed-tensors==0.11.0"
172140
if BUILD_TYPE == "release"

0 commit comments

Comments
 (0)