-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build on run instead of build on import
- Loading branch information
Showing
8 changed files
with
36 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
[mypy] | ||
files = src/ | ||
|
||
ignore_missing_imports = True | ||
strict_optional = False | ||
allow_redefinition = True | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import importlib.resources | ||
import shutil | ||
import subprocess | ||
|
||
|
||
def build(exe_name: str): | ||
|
||
if not importlib.resources.is_resource(__package__, exe_name): | ||
ctest = shutil.which("ctest") | ||
if not ctest: | ||
raise RuntimeError("could not find CMake") | ||
if not (shutil.which("ninja") or shutil.which("make")): | ||
raise RuntimeError("Ninja not found. Please do 'python -m pip install ninja'") | ||
with importlib.resources.path(__package__, "setup.cmake") as setup: | ||
ret = subprocess.run([ctest, "-S", str(setup), "-VV"]) | ||
if ret.returncode != 0: | ||
raise RuntimeError(f"not able to build {exe_name}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters