Skip to content

Commit b38d5d1

Browse files
authored
Merge pull request #749 from InfiniTensor/issue/723
issue/723 - Expose test framework to other packages
2 parents 28ef01c + ca45a67 commit b38d5d1

File tree

2 files changed

+27
-8
lines changed

2 files changed

+27
-8
lines changed

setup.py

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,34 @@
11
import subprocess
2-
3-
from setuptools import setup
2+
from setuptools import setup, find_packages
43
from setuptools.command.build import build
54

5+
def run_xmake_build():
6+
print("Running xmake build...")
7+
subprocess.run(["xmake", "build"], check=True)
8+
subprocess.run(["xmake", "install"], check=True)
9+
subprocess.run(["xmake", "build", "-y", "_infinicore"], check=True)
10+
subprocess.run(["xmake", "install", "_infinicore"], check=True)
611

712
class Build(build):
813
def run(self):
9-
subprocess.run(["xmake", "build"])
10-
subprocess.run(["xmake", "install"])
11-
subprocess.run(["xmake", "build", "-y", "_infinicore"])
12-
subprocess.run(["xmake", "install", "_infinicore"])
13-
14+
run_xmake_build()
15+
super().run()
1416

15-
setup(package_dir={"": "python"}, cmdclass={"build": Build})
17+
setup(
18+
# 1. Find main packages and manually add test/framework packages
19+
packages=find_packages(where="python") + [
20+
"infinicore.test",
21+
"infinicore.test.framework"
22+
],
23+
24+
# 2. Directory mappings
25+
package_dir={
26+
"": "python", # Root package is under python/ directory
27+
"infinicore.test": "test/infinicore" # Intermediate package mapping
28+
},
29+
30+
# 3. Register commands
31+
cmdclass={
32+
"build": Build
33+
}
34+
)

test/infinicore/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)