Skip to content

Commit b88225c

Browse files
committed
Update dependencies and improve Conan install command for better compatibility
1 parent 336e5dc commit b88225c

3 files changed

Lines changed: 283 additions & 181 deletions

File tree

hatch_build.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import os
44
import platform
55
import subprocess
6+
import shlex
7+
import glob
68

79
from hatchling.builders.hooks.plugin.interface import BuildHookInterface
810

@@ -33,10 +35,12 @@ def initialize(self, version: str, build_data: dict[str, Any]) -> None:
3335
else:
3436
build_packages = "-b missing"
3537

36-
install_cmd = (
38+
install_cmd_str = (
3739
f"conan install . -u {build_packages} -of build --format json -b b2/* -b m4/* --out-file graph.json"
3840
)
39-
result = subprocess.run(install_cmd, shell=True)
41+
42+
install_args = shlex.split(install_cmd_str)
43+
result = subprocess.run(install_args)
4044
assert result.returncode == 0, "Conan install failed"
4145

4246
if "CONAN_UPLOAD_OSP" in os.environ:
@@ -48,4 +52,5 @@ def initialize(self, version: str, build_data: dict[str, Any]) -> None:
4852
subprocess.run(["conan", "upload", "--confirm", "--list=pkglist.json", "--remote", "osp"], check=True)
4953

5054
if system_os == "Linux":
51-
subprocess.run(["patchelf", "--set-rpath", "$ORIGIN", "build/libcosimc/*"], check=True)
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)