-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathbuild.py
More file actions
25 lines (19 loc) · 911 Bytes
/
build.py
File metadata and controls
25 lines (19 loc) · 911 Bytes
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
#!/usr/bin/env python3
# Copyright 2019
# Author: Fabio Gutmann <https://github.com/fabio-gut>
import os
import sys
import subprocess
from shutil import rmtree, move
if __name__ == '__main__':
build_dir = os.path.abspath(os.path.join(__file__, os.pardir))
main = os.path.abspath(os.path.join(__file__, os.pardir, os.pardir, 'intarnapvalue', '__main__.py'))
subprocess.call( f'{sys.executable} -m PyInstaller -y -F "{main}"', shell=True )
os.remove(os.path.join(build_dir, '__main__.spec'))
rmtree(os.path.join(build_dir, 'build'))
os.mkdir(os.path.join(build_dir, 'build'))
if os.name == 'posix':
move(os.path.join(build_dir, 'dist', '__main__'), os.path.join(build_dir, 'build', 'IntaRNApvalue'))
else:
move(os.path.join(build_dir, 'dist', '__main__.exe'), os.path.join(build_dir, 'build', 'IntaRNApvalue.exe'))
rmtree(os.path.join(build_dir, 'dist'))