From 4e8acc16e9ad95c7799d9789a8b6bb315bf52444 Mon Sep 17 00:00:00 2001 From: An Long Date: Sun, 13 Sep 2026 22:16:57 +0900 Subject: [PATCH] fix: keep CI passing with ruff 0.16 and scikit-build-core 1.0 --- CHANGELOG.md | 1 + ggml/ggml.py | 7 ++++++- pyproject.toml | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e9e4215..4fc12130 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] - feat: add buffer protocol support to utils by @aisk in #175 +- fix: keep tests and lint passing with newer scikit-build-core and ruff by @aisk ## [0.0.45] diff --git a/ggml/ggml.py b/ggml/ggml.py index ac0f41ec..02465fbf 100644 --- a/ggml/ggml.py +++ b/ggml/ggml.py @@ -103,8 +103,13 @@ def load_shared_library(module_name: str, lib_base_name: str): path: Optional[pathlib.Path] = None for lib_name in lib_names: + # Prefer a plain filesystem lookup, which works regardless of how the + # package loader exposes resources (e.g. editable installs). + if (base_path / lib_name).exists(): + path = base_path / lib_name + break try: - with importlib_resources.as_file(importlib_resources.files(module_name).joinpath("lib", lib_name)) as p: # type: ignore + with importlib_resources.as_file(importlib_resources.files(module_name).joinpath("lib").joinpath(lib_name)) as p: # type: ignore p = cast(pathlib.Path, p) if os.path.exists(p): path = p diff --git a/pyproject.toml b/pyproject.toml index a6bbbbf4..ca5ef16f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,6 +48,9 @@ testpaths = "tests" target-version = "py38" extend-exclude = ["ggml/contrib/onnx.py", "tests/test_ggml_onnx.py"] +[tool.ruff.lint] +select = ["E4", "E7", "E9", "F"] + [tool.ruff.lint.per-file-ignores] "ggml/__init__.py" = ["F403"]