Skip to content

Commit f20f042

Browse files
committed
build.run: remove deprecated execute_local(run_script=) argument.
1 parent 0f27429 commit f20f042

File tree

1 file changed

+10
-18
lines changed

1 file changed

+10
-18
lines changed

amaranth/build/run.py

+10-18
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def extract(self, root="build"):
9393
finally:
9494
os.chdir(cwd)
9595

96-
def execute_local(self, root="build", *, run_script=None, env=None):
96+
def execute_local(self, root="build", *, env=None):
9797
"""
9898
Execute build plan using the local strategy. Files from the build plan are placed in
9999
the build root directory ``root``, and, if ``run_script`` is ``True``, the script
@@ -107,25 +107,17 @@ def execute_local(self, root="build", *, run_script=None, env=None):
107107
Returns :class:`LocalBuildProducts`.
108108
"""
109109
build_dir = self.extract(root)
110-
if run_script is None or run_script:
111-
if sys.platform.startswith("win32"):
112-
# Without "call", "cmd /c {}.bat" will return 0.
113-
# See https://stackoverflow.com/a/30736987 for a detailed explanation of why.
114-
# Running the script manually from a command prompt is unaffected.
115-
subprocess.check_call(["cmd", "/c", f"call {self.script}.bat"],
116-
cwd=build_dir, env=os.environ if env is None else env)
117-
else:
118-
subprocess.check_call(["sh", f"{self.script}.sh"],
119-
cwd=build_dir, env=os.environ if env is None else env)
120-
# TODO(amaranth-0.6): remove
121-
if run_script is not None:
122-
warnings.warn("The `run_script` argument is deprecated. If you only want to "
123-
"extract the files from the BuildPlan, use the .extract() method",
124-
DeprecationWarning, stacklevel=2)
125-
110+
if sys.platform.startswith("win32"):
111+
# Without "call", "cmd /c {}.bat" will return 0.
112+
# See https://stackoverflow.com/a/30736987 for a detailed explanation of why.
113+
# Running the script manually from a command prompt is unaffected.
114+
subprocess.check_call(["cmd", "/c", f"call {self.script}.bat"],
115+
cwd=build_dir, env=os.environ if env is None else env)
116+
else:
117+
subprocess.check_call(["sh", f"{self.script}.sh"],
118+
cwd=build_dir, env=os.environ if env is None else env)
126119
return LocalBuildProducts(build_dir)
127120

128-
129121
def execute_local_docker(self, image, *, root="build", docker_args=[]):
130122
"""
131123
Execute build plan inside a Docker container. Files from the build plan are placed in the

0 commit comments

Comments
 (0)