-
Notifications
You must be signed in to change notification settings - Fork 3
/
hatch_build.py
30 lines (26 loc) · 1.02 KB
/
hatch_build.py
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
from typing import Any, Dict
from hatchling.builders.hooks.plugin.interface import BuildHookInterface
from conans.client.conan_api import Conan
import os
import platform
class WheelHook(BuildHookInterface):
def initialize(self, version: str, build_data: Dict[str, Any]) -> None:
super().initialize(version, build_data)
build_data["infer_tag"] = True
build_data["pure_python"] = False
system_os = platform.system()
conan, _, _ = Conan.factory()
conan.config_set("general.revisions_enabled", "True")
conan.remote_add(
remote_name="osp",
url="https://osp.jfrog.io/artifactory/api/conan/conan-local",
force=True,
insert=0,
)
conan.install(
path="conan",
install_folder="build",
lockfile='conan/conan-linux64.lock' if system_os == "Linux" else 'conan/conan-win64.lock',
)
if system_os == "Linux":
os.system("patchelf --set-rpath '$ORIGIN' build/libcosimc/*")