Skip to content

Commit af47eec

Browse files
author
Denis Jelovina
committed
Refactor prebuilt module discovery to use a conventional out-of-source build directory when none is specified, preserving CI behavior.
1 parent c9a8536 commit af47eec

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

pyalp/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "alp-graphblas"
7-
version = "0.8.36"
7+
version = "0.8.37"
88
description = "Python bindings for ALP GraphBLAS (minimal package layout)"
99
authors = [ { name = "ALP" } ]
1010
readme = "README.md"

pyalp/setup.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,13 @@ def find_all_prebuilt():
5151
mapping = {}
5252

5353
cmake_build_dir = os.environ.get("CMAKE_BUILD_DIR") or os.environ.get("PYALP_BUILD_DIR")
54+
# If no explicit build dir is provided, fall back to the conventional
55+
# out-of-source `../build` directory. This keeps discovery inside a
56+
# single well-defined location and preserves prior CI behavior.
5457
if not cmake_build_dir:
55-
# No explicit build dir provided — do not search outside well-defined
56-
# locations. Return empty mapping to signal 'no prebuilt modules'.
57-
return mapping
58-
59-
cmake_build_dir = os.path.abspath(cmake_build_dir)
58+
cmake_build_dir = os.path.abspath(os.path.join(here, '..', 'build'))
59+
else:
60+
cmake_build_dir = os.path.abspath(cmake_build_dir)
6061

6162
for mod in supported:
6263
found = []
@@ -113,12 +114,9 @@ def build_extension(self, ext):
113114
if not src:
114115
src = prebuilt_modules.get(modname)
115116
if not src:
116-
# No explicit PREBUILT path or discovered prebuilt module in the
117-
# provided build directory. We do not search arbitrary locations;
118-
# instead, signal an error so the caller can provide the path via
119-
# PREBUILT_PYALP_SO or set CMAKE_BUILD_DIR so prebuilt discovery
120-
# will locate the artifacts.
121-
src = None
117+
# No explicit PREBUILT path or discovered prebuilt module in the
118+
# provided build directory. Do not search arbitrary locations.
119+
src = None
122120

123121
if not src or not os.path.exists(src):
124122
raise RuntimeError(f"Prebuilt pyalp shared object not found for module '{modname}' during build_ext")

0 commit comments

Comments
 (0)