Skip to content

Commit 002c3a4

Browse files
committed
Allow get_include to handle sdist installations
1 parent ab8a386 commit 002c3a4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: rtree/core.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from __future__ import annotations
2+
from importlib import resources
23

34
import ctypes
45
import os
@@ -76,7 +77,8 @@ def free_error_msg_ptr(result, func, cargs):
7677
def get_include():
7778
import rtree
7879

79-
return os.path.join(os.path.dirname(rtree.__file__), "include")
80+
include_dir = resources.files(rtree).joinpath("include")
81+
return str(include_dir) if include_dir.is_dir() else ""
8082

8183

8284
# load the shared library by looking in likely places

0 commit comments

Comments
 (0)