-
Notifications
You must be signed in to change notification settings - Fork 3
/
package4win.py
54 lines (46 loc) · 1.48 KB
/
package4win.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
#!/usr/bin/env python
# -*- coding: utf8 -*-
"""Tuttle"""
import sys
import re
from os.path import join
import six
try:
import setuptools
from cx_Freeze import setup, Executable
except ImportError:
print("You need to install setuptools and cx_freeze modules in order to create a Windows installer for tuttle. "
"You can install these packages with your package manager (usually python-setuptools) or via pip (pip"
" install setuptools cx_freeze).")
sys.exit(1)
from setup import tuttle_description # Import description of the package from the standard setup
def strip_rc(version):
m = re.search(r'^(\d+)\.(\d+)', version)
return m.group(0)
# cx_freeze option for a command line application
base = None
build_exe_options = {
"packages": ["os", "six", ],
"excludes": ["tkinter", ],
"includes": ["ConfigParser", "HTMLParser", ],
"include_files": (
six.__file__,
join("tuttle", "report"),
join("tuttle"),
)
}
build_msi_options = {
"add_to_path": True,
}
cx_freeze_opts = {
'options': {
'bdist_msi': build_msi_options,
'build_exe': build_exe_options
},
'executables': [Executable(join("bin", "tuttle"), base=base),
Executable(join("bin", "tuttle-extend-workflow"), base=base)],
}
package_description = tuttle_description
package_description.update(cx_freeze_opts)
package_description['version'] = strip_rc(package_description['version'])
setup(**package_description)