mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 08:35:14 +00:00
build-deps.py: add -y to skip initial confirmation prompt
This commit is contained in:
@@ -217,12 +217,7 @@ def build() -> None:
|
||||
for python_version in PYTHON_VERSIONS:
|
||||
os.environ["PYTHON_VERSION"] = python_version
|
||||
print(f"Building for Python {python_version}...")
|
||||
subprocess.run(
|
||||
[sys.executable, str(REPO_WIN / "build-deps.py"), build_generator(), "Release"],
|
||||
check=True,
|
||||
text=True,
|
||||
input="y\n",
|
||||
)
|
||||
run([sys.executable, str(REPO_WIN / "build-deps.py"), build_generator(), "Release", "-y"])
|
||||
OLD_ADD_COMMIT_SHA = set_env("ADD_COMMIT_SHA", "ON")
|
||||
run(
|
||||
[
|
||||
|
||||
+1
-6
@@ -22,7 +22,6 @@
|
||||
###############################################################################
|
||||
#
|
||||
import argparse
|
||||
import subprocess
|
||||
import sys
|
||||
from typing import NamedTuple, NoReturn
|
||||
|
||||
@@ -33,7 +32,6 @@ from common import (
|
||||
BuildCfg,
|
||||
HelpStrings,
|
||||
ensure_script_dir,
|
||||
logger,
|
||||
run_streamed,
|
||||
)
|
||||
|
||||
@@ -110,10 +108,7 @@ def main() -> None:
|
||||
|
||||
generator_args = [ARGS.generator] if ARGS.generator else []
|
||||
|
||||
# Auto-answer build-deps.py's "are you ready" prompt, same trick as build-all.cmd's "echo y |".
|
||||
build_deps_cmd = [sys.executable, str(SCRIPT_DIR / "build-deps.py"), *generator_args, ARGS.build_cfg]
|
||||
logger.info(f"$ {' '.join(build_deps_cmd)}")
|
||||
subprocess.run(build_deps_cmd, input="y\n", text=True, check=True)
|
||||
run_streamed(sys.executable, str(SCRIPT_DIR / "build-deps.py"), *generator_args, ARGS.build_cfg, "-y")
|
||||
|
||||
run_streamed(sys.executable, str(SCRIPT_DIR / "run-cmake.py"), *generator_args, "--", *ARGS.extra_args)
|
||||
run_streamed(sys.executable, str(SCRIPT_DIR / "build-ifcopenshell.py"), *generator_args, ARGS.build_cfg)
|
||||
|
||||
+15
-7
@@ -80,6 +80,7 @@ class Args(NamedTuple):
|
||||
num_build_procs: int
|
||||
install_python: bool
|
||||
install_qt6: bool
|
||||
yes: bool
|
||||
|
||||
|
||||
def print_build_config(
|
||||
@@ -229,6 +230,12 @@ def parse_args() -> Args:
|
||||
"(default: True)"
|
||||
),
|
||||
)
|
||||
parser.add_argument(
|
||||
"-y",
|
||||
"--yes",
|
||||
action="store_true",
|
||||
help="Skip the confirmation prompt before proceeding with the build.",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
logger.setLevel(args.log_level)
|
||||
|
||||
@@ -257,6 +264,7 @@ def parse_args() -> Args:
|
||||
num_build_procs=num_build_procs,
|
||||
install_python=install_python,
|
||||
install_qt6=install_qt6,
|
||||
yes=args.yes,
|
||||
)
|
||||
|
||||
|
||||
@@ -316,13 +324,13 @@ def main() -> None:
|
||||
)
|
||||
|
||||
logger.warning("Warning: You will need roughly 8 GB of disk space to proceed.\n")
|
||||
logger.info(
|
||||
"If you are not ready with the above: type 'n' in the prompt below. Build proceeds on all other inputs!"
|
||||
)
|
||||
# TODO: add a `-y` option to skip this prompt.
|
||||
do_continue = input("> ")
|
||||
if do_continue == "n":
|
||||
sys.exit(0)
|
||||
if not ARGS.yes:
|
||||
logger.info(
|
||||
"If you are not ready with the above: type 'n' in the prompt below. Build proceeds on all other inputs!"
|
||||
)
|
||||
do_continue = input("> ")
|
||||
if do_continue == "n":
|
||||
sys.exit(0)
|
||||
|
||||
START_TIME = datetime.now().replace(microsecond=0)
|
||||
logger.info(f"Build started at {START_TIME}.")
|
||||
|
||||
Reference in New Issue
Block a user