Skip to content

Commit 53c71f5

Browse files
committed
Add special treatment for Windows
1 parent 4f026cd commit 53c71f5

2 files changed

Lines changed: 15 additions & 13 deletions

File tree

.github/workflows/makefile.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,9 @@ jobs:
2525
run: make PYTHON=python
2626

2727
- name: Run check
28-
run: make check PYTHON=python PYTHONPATH=$PYTHONPATH:$PWD
29-
28+
run: |
29+
if [ "$RUNNER_OS" == "Windows" ]; then
30+
make check PYTHON=python PYTHONPATH=${PYTHONPATH}:$PWD
31+
else
32+
make check PYTHON=python PYTHONPATH=$PYTHONPATH:$PWD
33+
fi

setup.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# SPDX-License-Identifier: BSD-3-Clause
66
# <<END-copyright>>
77

8-
import os, sys, glob, shutil, pathlib
8+
import os, sys, glob, shutil
99
import setuptools
1010
from setuptools.command.install import install
1111
from setuptools.command.build_ext import build_ext
@@ -26,25 +26,23 @@
2626
class CustomInstall(install):
2727
"""Custom handler for the 'install' command."""
2828
def run(self):
29-
print("In CustomInstall run:")
3029
# copy C executables Merced/bin/merced and fudge/processing/deterministic/upscatter/bin/calcUpscatterKernel to Python environment bin folder
3130
workingFolder = os.getcwd()
3231
binFolder = os.path.join(sys.prefix, 'bin')
3332
os.chdir('Merced')
3433
subprocess.check_call('make -j', shell=True)
35-
36-
sbd = pathlib.Path("Src")
37-
print("Contents of Src:", list(sbd.iterdir()))
38-
bbd = pathlib.Path("bin")
39-
print("Contents of bin:", list(bbd.iterdir()))
40-
41-
print("After building, copy to", binFolder)
42-
shutil.copy(pathlib.Path("bin") / "merced", binFolder)
34+
executable = "bin/merced"
35+
if sys.platform.startswith('win'):
36+
executable = "bin/merced.exe"
37+
shutil.copy(executable, binFolder)
4338
os.chdir(workingFolder)
4439

4540
os.chdir('fudge/processing/deterministic/upscatter')
4641
subprocess.check_call('make -j', shell=True)
47-
shutil.copy(pathlib.Path("bin") / "calcUpscatterKernel", binFolder)
42+
executable = "bin/calcUpscatterKernel"
43+
if sys.platform.startswith('win'):
44+
executable = "bin/calcUpscatterKernel.exe"
45+
shutil.copy(executable, binFolder)
4846
os.chdir(workingFolder)
4947

5048
super().run()

0 commit comments

Comments
 (0)