forked from InfiniTensor/InfiniCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
34 lines (29 loc) · 970 Bytes
/
setup.py
File metadata and controls
34 lines (29 loc) · 970 Bytes
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
import subprocess
from setuptools import setup, find_packages
from setuptools.command.build import build
def run_xmake_build():
print("Running xmake build...")
subprocess.run(["xmake", "build"], check=True)
subprocess.run(["xmake", "install"], check=True)
subprocess.run(["xmake", "build", "-y", "_infinicore"], check=True)
subprocess.run(["xmake", "install", "_infinicore"], check=True)
class Build(build):
def run(self):
run_xmake_build()
super().run()
setup(
# 1. Find main packages and manually add test/framework packages
packages=find_packages(where="python") + [
"infinicore.test",
"infinicore.test.framework"
],
# 2. Directory mappings
package_dir={
"": "python", # Root package is under python/ directory
"infinicore.test": "test/infinicore" # Intermediate package mapping
},
# 3. Register commands
cmdclass={
"build": Build
}
)