diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e9e421..4fc1213 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 ac0f41e..02465fb 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 a6bbbbf..ca5ef16 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"]