-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.py
25 lines (21 loc) · 952 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
from sys import platform
import os
import zipfile
from funcs import zip
def run(command):
return subprocess.check_output(command,shell=True).decode("utf-8")
if platform == "win32" or platform == "win64":
ver = input("Build Version: ")
print("--> Creating directories...")
os.system(f"cd dist && mkdir {ver}")
os.system(f"cd dist/{ver} && mkdir src")
print("--> Building binary....")
os.system(f"python setup.py py2exe -d dist/{ver}/src/")
print(f"--> Built binary in dist/{ver}/src/")
print("--> Building zip...")
zip(f"dist/{ver}/{ver}",f"dist/{ver}/src/")
elif platform == "linux" or platform == "linux2":
print("--> Installing dependencies...")
run("sudo pip install nuitka")
print("--> Building...")
run("sudo python -m nuitka --follow-imports --include-plugin-directory=core --include-plugin-directory=index --include-plugin-directory=guess --include-plugin-directory=resources upm.py")