Skip to content

Commit

Permalink
Update build_ext.py
Browse files Browse the repository at this point in the history
  • Loading branch information
christoph2 committed Oct 24, 2024
1 parent 3012f57 commit 6e1f377
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions build_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,19 @@ def banner(msg: str) -> None:
print("=" * 80)


def get_env_int(name: str, default: int = 0) -> int:
return int(os.environ.get(name, default))


def get_env_bool(name: str, default: int = 0) -> bool:
return get_env_int(name, default)


def build_extension(debug: bool = False, use_temp_dir=False) -> None:
print("build_ext::build_extension()")

use_temp_dir = use_temp_dir or os.environ.get("BUILD_TEMP")
debug = debug or os.environ.get("BUILD_DEBUG")
use_temp_dir = use_temp_dir or get_env_bool("BUILD_TEMP")
debug = debug or get_env_bool("BUILD_DEBUG")

antlr4_tag = most_recent_tag("https://github.com/antlr/antlr4")
print("antlr4_tag", antlr4_tag)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ requires = ["poetry-core>=1.6.0", "wheel", "cmake>=3.12", "pybind11[global]>=2.1
build-backend = "poetry.core.masonry.api"


[project.scripts]
[tool.poetry.scripts]
a2ldb-imex = "pya2l.scripts.a2ldb_imex:main"

[tool.pytest]
Expand Down

0 comments on commit 6e1f377

Please sign in to comment.