Skip to content

Commit 25d1598

Browse files
committed
[FIX] Benchmarks setup.py - remediate pylint and yapf is
1 parent acf7a5f commit 25d1598

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

benchmarks/setup.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,21 +128,25 @@ def run(self):
128128
def get_git_commit_hash(length=8):
129129
try:
130130
cmd = ["git", "rev-parse", f"--short={length}", "HEAD"]
131-
return "+git{}".format(subprocess.check_output(cmd).strip().decode("utf-8"))
132-
except Exception:
131+
return f"+git{subprocess.check_output(cmd).strip().decode('utf-8')}"
132+
except (
133+
FileNotFoundError,
134+
subprocess.CalledProcessError,
135+
subprocess.TimeoutExpired,
136+
):
133137
return ""
134138

135139

136-
def get_install_requires():
137-
install_requires = ["torch", "matplotlib", "pandas", "tabulate"] # yapf: disable
138-
return install_requires
139-
140-
141140
setup(
142141
name="triton-kernels-benchmark",
143142
version="3.1.0" + get_git_commit_hash(),
144143
packages=["triton_kernels_benchmark"],
145-
install_requires=get_install_requires(),
144+
install_requires=[
145+
"torch",
146+
"pandas",
147+
"tabulate",
148+
"matplotlib",
149+
],
146150
package_dir={"triton_kernels_benchmark": "triton_kernels_benchmark"},
147151
package_data={"triton_kernels_benchmark": ["xetla_kernel.cpython-*.so"]},
148152
cmdclass={
@@ -152,6 +156,6 @@ def get_install_requires():
152156
ext_modules=[CMakeExtension("triton_kernels_benchmark")],
153157
extra_require={
154158
"ipex": ["numpy<=2.0", "intel-extension-for-pytorch=2.1.10"],
155-
"pytorch": ["torch>=2.6"]
159+
"pytorch": ["torch>=2.6"],
156160
},
157161
)

0 commit comments

Comments
 (0)