Skip to content

Commit

Permalink
Allow get_include to handle sdist installations
Browse files Browse the repository at this point in the history
  • Loading branch information
JDBetteridge committed Nov 24, 2023
1 parent ab8a386 commit 002c3a4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rtree/core.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from __future__ import annotations
from importlib import resources

import ctypes
import os
Expand Down Expand Up @@ -76,7 +77,8 @@ def free_error_msg_ptr(result, func, cargs):
def get_include():
import rtree

return os.path.join(os.path.dirname(rtree.__file__), "include")
include_dir = resources.files(rtree).joinpath("include")
return str(include_dir) if include_dir.is_dir() else ""


# load the shared library by looking in likely places
Expand Down

0 comments on commit 002c3a4

Please sign in to comment.