Skip to content

Commit

Permalink
fix library-loading issues in editable installs
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb committed Nov 15, 2024
1 parent 3f66927 commit 21a5b4e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ jobs:
build_command: |
sccache -z;
build-all --verbose;
python -c "import kvikio; print(kvikio.__version__)";
sccache -s;
wheel-cpp-build:
secrets: inherit
Expand Down
12 changes: 9 additions & 3 deletions python/libkvikio/libkvikio/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,15 @@ def load_library():
# Prefer the libraries bundled in this package. If they aren't found
# (which might be the case in builds where the library was prebuilt
# before packaging the wheel), look for a system installation.
libkvikio_lib = _load_wheel_installation(soname)
if libkvikio_lib is None:
libkvikio_lib = _load_system_installation(soname)
try:
libkvikio_lib = _load_wheel_installation(soname)
if libkvikio_lib is None:
libkvikio_lib = _load_system_installation(soname)
except OSError:
# If none of the searches above succeed, just silently return None
# and rely on other mechanisms (like RPATHs on other DSOs) to
# help the loader find the library.
pass

# The caller almost never needs to do anything with this library, but no
# harm in offering the option since this object at least provides a handle
Expand Down

0 comments on commit 21a5b4e

Please sign in to comment.