feat(build system): Remove build.py (switched to tox), add output to build_gui.py

This commit is contained in:
Daniel S. 2019-09-28 15:37:32 +02:00
parent d498746a5c
commit fb3a13037c
2 changed files with 1 additions and 66 deletions

View file

@ -1,66 +0,0 @@
import subprocess as SP
from glob import glob
import os
import shutil
import pkg_resources as pkg
from contextlib import contextmanager
@contextmanager
def in_dir(name,remove=False):
pwd=os.getcwd()
if os.path.isdir(name):
shutil.rmtree(name)
os.makedirs(name)
os.chdir(name)
yield
os.chdir(pwd)
if remove:
shutil.rmtree(name)
SP.check_call(["pip", "install", "PyQt5"])
ui_path = os.path.dirname(os.path.abspath(__file__))
for root, folders, files in os.walk(ui_path):
for file in files:
file = os.path.join(root, file)
outfile, ext = os.path.splitext(file)
if ext == ".ui":
outfile = outfile + ".py"
print(os.path.basename(file), "->", os.path.basename(outfile))
SP.check_call(["pyuic5", "--from-imports", "-o", outfile, file])
SP.check_call(["pip", "install", ".[dev]"])
main_py=os.path.abspath("ed_lrr_gui\__main__.py")
with in_dir("exe"):
with in_dir("pyinstaller"):
SP.check_call(
[
"pyinstaller",
"--clean",
"--noupx",
"-c",
'--key="ED_LRR_GUI"',
"--name",
"ED_LRR",
main_py,
]
)
with in_dir("nuitka"):
SP.check_call(
[
"python",
"-m",
"nuitka",
"--plugin-enable=multiprocessing",
"--plugin-enable=qt-plugins",
"--standalone",
"--follow-imports",
main_py,
]
)
# with in_dir("installer"):
# shutil.rmtree("Output")
# SP.check_call(["iscc", "/QP", "ED_LRR.iss"])

View file

@ -10,4 +10,5 @@ for root, folders, files in os.walk(ui_path):
outfile, ext = os.path.splitext(file)
if ext == ".ui":
outfile = outfile + ".py"
print(file,"->",outfile)
SP.check_call(["pyuic5", "--from-imports", "-o", outfile, file])