Skip to content

Commit 020ccab

Browse files
committed
Merge branch 'master' into cosimc-loading-fix
# Conflicts: # uv.lock
2 parents 08e112f + 09344dc commit 020ccab

3 files changed

Lines changed: 299 additions & 270 deletions

File tree

hatch_build.py

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
import inspect
33
import os
44
import platform
5+
import subprocess
6+
import shlex
7+
import glob
58

69
from hatchling.builders.hooks.plugin.interface import BuildHookInterface
710

@@ -14,8 +17,11 @@ def initialize(self, version: str, build_data: dict[str, Any]) -> None:
1417
build_data["infer_tag"] = True
1518
build_data["pure_python"] = False
1619

17-
os.system("conan remote add osp https://osp.jfrog.io/artifactory/api/conan/conan-local --force")
18-
os.system("conan profile detect --force")
20+
subprocess.run(
21+
["conan", "remote", "add", "osp", "https://osp.jfrog.io/artifactory/api/conan/conan-local", "--force"],
22+
check=True,
23+
)
24+
subprocess.run(["conan", "profile", "detect", "--force"], check=True)
1925

2026
for frame_info in inspect.stack():
2127
frame = frame_info.frame
@@ -29,14 +35,22 @@ def initialize(self, version: str, build_data: dict[str, Any]) -> None:
2935
else:
3036
build_packages = "-b missing"
3137

32-
assert (
33-
os.system(f"conan install . -u {build_packages} -of build --format json -b b2/* --out-file graph.json") == 0
34-
), "Conan install failed"
38+
install_cmd_str = (
39+
f"conan install . -u {build_packages} -of build --format json -b b2/* -b m4/* --out-file graph.json"
40+
)
41+
42+
install_args = shlex.split(install_cmd_str)
43+
result = subprocess.run(install_args)
44+
assert result.returncode == 0, "Conan install failed"
3545

3646
if "CONAN_UPLOAD_OSP" in os.environ:
3747
print("Uploading packages..")
38-
os.system("conan list --graph=graph.json --format=json > pkglist.json")
39-
os.system("conan upload --confirm --list=pkglist.json --remote osp")
48+
with open("pkglist.json", "w") as pkglist_file:
49+
subprocess.run(
50+
["conan", "list", "--graph=graph.json", "--format=json"], check=True, stdout=pkglist_file
51+
)
52+
subprocess.run(["conan", "upload", "--confirm", "--list=pkglist.json", "--remote", "osp"], check=True)
4053

4154
if system_os == "Linux":
42-
os.system("patchelf --set-rpath '$ORIGIN' build/libcosimc/*")
55+
for libfile in glob.glob("build/libcosimc/*"):
56+
subprocess.run(["patchelf", "--set-rpath", "$ORIGIN", libfile], check=True)

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ classifiers = [
3030

3131
[dependency-groups]
3232
dev = [
33-
"conan~=2.15.1",
34-
"ruff~=0.11.7",
33+
"conan>=2.27.0",
34+
"ruff>=0.15.0",
3535
"pyright>=1.1.400",
3636
"pytest>=8.3.5",
3737
]
@@ -45,7 +45,7 @@ exclude = ["tests", ".github"]
4545

4646
[tool.hatch.build.targets.wheel.hooks.custom]
4747
dependencies = [
48-
"conan~=2.15.1",
48+
"conan>=2.27.0",
4949
"hatchling~=1.13",
5050
"cmake>=3.10,<4.0",
5151
"patchelf>=0.17.2; platform_system == 'Linux'"

0 commit comments

Comments
 (0)