-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
78 lines (63 loc) · 1.9 KB
/
setup.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
"""
cx_Freeze script for building pyopenVA App. Build the windows installer
with
python setup.py bdist_msi
and the macOS installer with
python setup.py bdist_dmg
"""
import sys
from cx_Freeze import Executable, setup
import os
import subprocess
# create docs
subprocess.run(["sphinx-build", "-b", "html", "docs/source",
"pyopenva/docs", "-a"])
here = os.path.abspath(os.path.dirname(__file__))
about = {}
with open(
os.path.join(here, "pyopenva", "__version__.py"),
mode="r",
encoding="utf-8") as f:
exec(f.read(), about)
version = "v" + about["__version__"]
include_files = ["pyopenva/data", "pyopenva/docs"]
# base="Win32GUI" should be used only for Windows GUI app
base = "Win32GUI" if sys.platform == "win32" else None
build_exe_options = {
"excludes": ["tkinter"],
"include_files": include_files,
"bin_excludes": ["libpq.5.dylib"],
}
bdist_mac_options = {
"bundle_name": "pyopenVA-" + version,
"iconfile": "pyopenva/icons/openva-logo.ico",
}
bdist_dmg_options = {
"volume_label": "pyopenVA-" + version,
}
directory_table = [
("ProgramMenuFolder", "TARGETDIR", "."),
("MyProgramMenu", "ProgramMenuFolder", "MYPROG~1|My Program"),
]
executables = [
Executable(
"pyopenva/main.py",
base=base,
icon="pyopenva/icons/openva-logo.ico",
shortcut_name="pyopenVA-" + version,
shortcut_dir="DesktopFolder",
target_name="pyopenVA-" + version
),
]
setup(
name="pyopenVA",
version=about["__version__"],
description=about["__description__"],
options={
"build_exe": build_exe_options,
"bdist_mac": bdist_mac_options,
"bdist_dmg": bdist_dmg_options,
# "bdist_msi": {"target_name": "pyopenVA-" + version + ".msi"},
},
executables=executables,
)