-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
42 lines (33 loc) · 1.07 KB
/
Copy pathsetup.py
File metadata and controls
42 lines (33 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import os
from subprocess import run
from subprocess import CalledProcessError
from setuptools import setup
from setuptools.command.build import build
import shutil
class MakeBuild(build):
def finalize_options(self):
super().finalize_options()
# ensure attribute exists
self.build_lib = getattr(self, "build_lib", os.path.abspath(os.path.join(self.build_base, "lib")))
def run(self):
try:
result = run(["make", "all"], capture_output=True, text=True,check=True,)
except CalledProcessError as call_error:
print(call_error)
print(call_error.stdout)
print(call_error.stderr)
print(result.stdout)
print(result.stderr)
# Copy compiled artifact into package
shutil.copy(
"build/yinit-bin",
"yinit-bin",
)
#subprocess.check_call(["pwd"], cwd="..")
super().run()
#subprocess.check_call(["make"], #cwd=self.distribution.get_command_obj("build").build_base)
setup(
cmdclass={
"build": MakeBuild,
},
)