Skip to content

Commit 321fc26

Browse files
Merge pull request #129 from jaredraycoleman/windows-support
Fix cpu-benchmark installation for Docker-based tests
2 parents 6cd6a7b + e5ca3ba commit 321fc26

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

setup.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,17 @@ def run(self):
3131
sys.stderr.write("This is expected on Windows. To build cpu-benchmark, install make and g++.\n")
3232
super().run()
3333

34-
# Conditionally include cpu-benchmark if it exists
34+
# Conditionally include cpu-benchmark based on platform
3535
data_files = []
36-
cpu_benchmark_path = 'bin/cpu-benchmark'
37-
if os.path.exists(cpu_benchmark_path):
38-
data_files.append(('bin', [cpu_benchmark_path]))
36+
if sys.platform != 'win32':
37+
# On Unix-like systems (Linux, macOS, Docker), always try to include it
38+
# The Build class will create it during the build process
39+
data_files.append(('bin', ['bin/cpu-benchmark']))
40+
else:
41+
# On Windows, only include if it exists (e.g., if user manually compiled it)
42+
cpu_benchmark_path = 'bin/cpu-benchmark'
43+
if os.path.exists(cpu_benchmark_path):
44+
data_files.append(('bin', [cpu_benchmark_path]))
3945

4046
setup(
4147
packages=find_packages(),

0 commit comments

Comments
 (0)