-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup_cxfreeze.py
82 lines (73 loc) · 1.84 KB
/
setup_cxfreeze.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import os
import re
import sys
from cx_Freeze import Executable, setup
ROOT = os.path.abspath(os.path.dirname(__file__))
VERSION_RE = re.compile(r'''__version__ = ['"]([0-9.]+)['"]''')
python_install_dir, _ = os.path.split(sys.executable)
site_packages_path = os.path.join(python_install_dir, 'Lib', 'site-packages')
def get_version():
init = open(os.path.join(ROOT, 'clipmanager', '__init__.py')).read()
return VERSION_RE.search(init).group(1)
build_options = dict(
optimize=2,
include_msvcr=False, # Microsoft Visual C runtime DLLs
include_files=[
(
os.path.join(site_packages_path,
'PySide\plugins\sqldrivers\qsqlite4.dll'),
os.path.join('sqldrivers', 'qsqlite4.dll')
),
],
# packages to include, which includes all submodules in the package
packages=[
'ctypes',
'datetime',
'itertools',
'logging',
'operator',
'optparse',
'os',
're',
'struct',
'subprocess',
'sys',
'tempfile',
'textwrap',
'win32api',
'win32event',
'win32gui',
'win32process',
'winerror',
'zlib',
],
# modules to include
includes=[
'PySide.QtCore',
'PySide.QtGui',
'PySide.QtNetwork',
'PySide.QtSql',
],
# modules to exclude
excludes=[
'json',
'Tkinter',
'unittest',
'Xlib',
'xml',
])
executables = [
Executable(
'bin/clipmanager',
base='Win32GUI',
targetName='clipmanager.exe',
icon='clipmanager/icons/clipmanager.ico'
)
]
setup(
name='clipmanager',
version=get_version(),
description="Manage the system's clipboard history.",
options=dict(build_exe=build_options),
executables=executables
)