"test/srt/rl/test_verl_engine_4_gpu.py" did not exist on "0194948fd96802ea41d6baa3673e9d42cfa5dc8c"
setup.py 743 Bytes
Newer Older
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
import glob
import os
import subprocess
from pathlib import Path

from setuptools import setup
from setuptools.command.build_py import build_py

INSTALLATION_DIR = os.getenv("INFINI_ROOT", str(Path.home() / ".infini"))

LIB_DIR = os.path.join(INSTALLATION_DIR, "lib")

PACKAGE_NAME = "infinicore"

PACKAGE_DIR = os.path.join(INSTALLATION_DIR, PACKAGE_NAME)


class BuildPy(build_py):
    def run(self):
        subprocess.run(["xmake", "build", "-y"])
        subprocess.run(["xmake", "install"])
        built_lib = glob.glob(os.path.join(LIB_DIR, f"{PACKAGE_NAME}.*"))[0]
        os.makedirs(PACKAGE_DIR, exist_ok=True)
        self.copy_file(built_lib, PACKAGE_DIR)


setup(
    cmdclass={"build_py": BuildPy},
    package_dir={"": "."},
)