-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.py
29 lines (21 loc) · 799 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
import os
import shutil
import subprocess
version = "v0.2.5"
project_root_directory = os.path.dirname(os.path.abspath(__file__))
os.chdir(os.path.join(project_root_directory, "static"))
subprocess.run("npm run build", shell=True)
os.chdir(project_root_directory)
distribution_directory = f"pulp-scheduling-{version}"
if os.path.exists(distribution_directory):
shutil.rmtree(distribution_directory)
subprocess.run(
f"pyinstaller main.spec --clean --distpath {distribution_directory}", shell=True
)
shutil.copytree(
"data", os.path.join(distribution_directory, "data"), copy_function=shutil.copy
)
os.chdir(os.path.join(project_root_directory, "static"))
subprocess.run("npm run readme", shell=True)
os.chdir(project_root_directory)
shutil.copy("demo.gif", distribution_directory)