Unverified Commit b38d5d16 authored by thatPepe's avatar thatPepe Committed by GitHub
Browse files

Merge pull request #749 from InfiniTensor/issue/723

issue/723 - Expose test framework to other packages
parents 28ef01ca ca45a67c
import subprocess import subprocess
from setuptools import setup, find_packages
from setuptools import setup
from setuptools.command.build import build 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): class Build(build):
def run(self): def run(self):
subprocess.run(["xmake", "build"]) run_xmake_build()
subprocess.run(["xmake", "install"]) super().run()
subprocess.run(["xmake", "build", "-y", "_infinicore"])
subprocess.run(["xmake", "install", "_infinicore"])
setup(package_dir={"": "python"}, cmdclass={"build": Build}) 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
}
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment