项目文件夹

文件
wehub-resource-sync 2c632336aa
CI / Viewer CI (push) Successful in 13m37s
CI / Core CI (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:32:38 +08:00

27 行
744 B
Python

from __future__ import annotations
import importlib
from typing import Any
_REPO_SYNC_COMMAND = "uv sync --group dev"
def _install_command_hint() -> str:
return f"Run `{_REPO_SYNC_COMMAND}` from the repository root, then retry."
def _missing_dependency_message(*, feature: str, dependency: str) -> str:
return (
f"{feature} requires the `{dependency}` package, but it is not installed in the current "
f"environment. {_install_command_hint()}"
)
def require_cadquery(*, feature: str) -> Any:
try:
return importlib.import_module("cadquery")
except Exception as exc:
raise RuntimeError(
_missing_dependency_message(feature=feature, dependency="cadquery")
) from exc