52 lines
1.9 KiB
Python
52 lines
1.9 KiB
Python
|
# -*-mode: python; indent-tabs-mode: nil; py-indent-offset: 4; coding: utf-8 -*-
|
||
|
|
||
|
from __future__ import unicode_literals, print_function
|
||
|
import optparse
|
||
|
import os
|
||
|
import sys
|
||
|
|
||
|
import cx_Freeze
|
||
|
from cx_Freeze import cli
|
||
|
|
||
|
ROLE="proxy" # noqa
|
||
|
|
||
|
def main(constants):
|
||
|
# options = cx_Freeze.ParseCommandLine()
|
||
|
parser = cli.prepare_parser()
|
||
|
args = cli.parse_command_line(parser)
|
||
|
executables = [cx_Freeze.Executable(args.script,
|
||
|
args.init_script,
|
||
|
args.base_name,
|
||
|
args.target_name,
|
||
|
args.icon)
|
||
|
]
|
||
|
args.includes += ['wcwidth']
|
||
|
args.excludes += ['numpy', 'sphinx', 'matplotlib', 'numpy', 'PyQt5', 'pandas', 'babel', 'wx', 'pythran', 'scipy', 'notebook', 'PySide2']
|
||
|
args.zip_include_packages='*'
|
||
|
args.zip_exclude_packages=''
|
||
|
freezer = cx_Freeze.Freezer(executables,
|
||
|
includes=args.includes,
|
||
|
excludes=args.excludes,
|
||
|
packages=args.packages,
|
||
|
replacePaths=args.replace_paths,
|
||
|
compress=args.compress,
|
||
|
optimizeFlag=args.optimize_flag,
|
||
|
targetDir=args.target_dir,
|
||
|
includeFiles=args.include_files,
|
||
|
zipIncludes=args.zip_includes,
|
||
|
silent=args.silent,
|
||
|
zipIncludePackages=args.zip_include_packages,
|
||
|
zipExcludePackages=args.zip_exclude_packages,
|
||
|
)
|
||
|
freezer.Freeze()
|
||
|
return 0
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
from cx_Freeze import freezer
|
||
|
constants = freezer.ConstantsModule()
|
||
|
try:
|
||
|
i = main(constants)
|
||
|
except KeyboardInterrupt:
|
||
|
i =0
|
||
|
sys.exit(i)
|