Skip to content

Commit 4926a38

Browse files
committed
simplify setup.py slightly
1 parent aab36ad commit 4926a38

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

setup.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import print_function
22

33
import pipes
4-
import shutil
54
import subprocess
65
import sys
76
import traceback
@@ -130,15 +129,10 @@ def run(self):
130129
log.info("Installing Javascript...")
131130
try:
132131
js_dir = str(package_dir / "client" / "app")
133-
for cmd, *args in map(str.split, ["npm install", "npm run build"]):
134-
which_cmd = shutil.which(cmd)
135-
if which_cmd is None:
136-
raise RuntimeError(
137-
f"Failed to run command - {cmd!r} is not installed."
138-
)
139-
cmd_args = [which_cmd] + args
140-
log.info(f"> {list2cmdline(cmd_args)}")
141-
subprocess.check_call(cmd_args, cwd=js_dir)
132+
for args in ("npm install", "npm run build"):
133+
args_list = args.split()
134+
log.info(f"> {list2cmdline(args_list)}")
135+
subprocess.run(args_list, cwd=js_dir)
142136
except Exception:
143137
log.error("Failed to install Javascript")
144138
log.error(traceback.format_exc())

src/idom/client/module.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def __init__(
125125

126126
if self.source_type == URL_SOURCE:
127127
if check_exports is True:
128-
raise ValueError(f"Cannot check exports of source type {source_type!r}")
128+
raise ValueError(f"Can't check exports for source type {source_type!r}")
129129
elif source_file is not None:
130130
raise ValueError(f"File given, but source type is {source_type!r}")
131131
else:

0 commit comments

Comments
 (0)