forked from ryanc414/pytest_commander
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.py
executable file
·37 lines (28 loc) · 869 Bytes
/
build.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python3
"""
Build everything from source.
Handles:
1. Install npm dependencies and build the UI client
2. Build source and binary distributions of the python package.
"""
import os
import shutil
import subprocess
import sys
WEB_CLIENT_DIR = os.path.join(
os.path.dirname(__file__), "pytest_commander", "web_client"
)
def main():
npm_exe = shutil.which("npm")
if not npm_exe:
sys.exit(
"Error, could not find npm installation. Ensure that npm is "
"installed and on your PATH."
)
print("Building UI...")
subprocess.check_call([npm_exe, "install"], cwd=WEB_CLIENT_DIR)
subprocess.check_call([npm_exe, "run", "build"], cwd=WEB_CLIENT_DIR)
print("Done! Find source archive and wheel under dist/")
print("Run tests with: $ python test.py")
if __name__ == "__main__":
main()