Skip to content

Commit 8701c4b

Browse files
committed
use PGM NO BUILD
Signed-off-by: Tony Xiang <19280867+TonyXiang8787@users.noreply.github.com>
1 parent b42008d commit 8701c4b

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

.github/workflows/main.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,10 @@ jobs:
240240
shell: bash -el {0}
241241
- os: windows
242242
shell: powershell
243-
243+
244+
env:
245+
POWER_GRID_MODEL_NO_BINARY_BUILD: 1
246+
244247
defaults:
245248
run:
246249
shell: ${{ matrix.shell }}

setup.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,10 @@ def generate_build_ext(pkg_dir: Path, pkg_name: str):
139139
print(f"Remove binary file: {bin_file}")
140140
bin_file.unlink()
141141

142-
# if we are building this in conda enviroment
143-
# we do not need extension module
144-
if "CONDA_PREFIX" in os.environ:
142+
# By setting POWER_GRID_MODEL_NO_BINARY_BUILD we do not build the extension.
143+
# This is usually set in conda-build recipe, so conda build process only wraps the pure Python package.
144+
# As a user or developer, DO NOT set this environment variable unless you really know what you are doing.
145+
if "POWER_GRID_MODEL_NO_BINARY_BUILD" in os.environ:
145146
return {}
146147

147148
# fetch dependent headers

0 commit comments

Comments
 (0)