-
Notifications
You must be signed in to change notification settings - Fork 6
/
make_executable.py
36 lines (30 loc) · 1020 Bytes
/
make_executable.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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "Vadym Stupakov"
__email__ = "[email protected]"
from subprocess import call
import sys
from shlex import split
import os
from pathlib import Path
ROOT_PATH = Path(__file__).parent
BUILD_DIR = ROOT_PATH / "build"
SCRIPT_PATH = ROOT_PATH / "python_ftp_server/ftp_server.py"
if __name__ == '__main__':
env = os.environ.copy()
env["PYTHONUNBUFFERED"] = "1"
env["PYTHONUTF8"] = "1"
env["PYTHONWARNINGS"] = "ignore"
env["PYTHONNOUSERSITE"] = "1"
opts = split(f"""
--clean
--noupx
--onefile
--noconfirm
--workpath={BUILD_DIR.as_posix()}/work_dir
--specpath={BUILD_DIR.as_posix()}/work_dir
--distpath={ROOT_PATH.as_posix()}
--name=ftp_server {SCRIPT_PATH.as_posix()}
"""
)
call([sys.executable, "-m", "PyInstaller.__main__"] + opts, env=os.environ.copy())