-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.py
104 lines (93 loc) · 3.51 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import sys
import os
from cx_Freeze import setup, Executable
options = {}
NAME = 'pyJTT'
path = ["pyjtt"] + sys.path
icon_path = os.path.join("resources", "icons", "icon.icns")
build_exe_options = {
'path': path,
'include_msvcr': True,
"excludes": [
"PyQt6.QtNetwork",
"PyQt6.QtMultimedia",
"PyQt6.QtBluetooth",
],
}
# http://msdn.microsoft.com/en-us/library/windows/desktop/aa371847(v=vs.85).aspx
shortcut_table = [
("DesktopShortcut", # Shortcut
"DesktopFolder", # Directory_
NAME, # Name
"TARGETDIR", # Component_
"[TARGETDIR]pyjtt.exe", # Target
None, # Arguments
None, # Description
None, # Hotkey
None, # Icon
None, # IconIndex
None, # ShowCmd
'%APPDATA%\pyjtt' # WkDir
),
("ProgramMenuShortcut", # Shortcut
"ProgramMenuFolder", # Directory_
"pyJTT", # Name
"TARGETDIR", # Component_
"[TARGETDIR]pyjtt.exe", # Target
None, # Arguments
None, # Description
None, # Hotkey
None, # Icon
None, # IconIndex
None, # ShowCmd
'%APPDATA%\pyjtt' # WkDir
)]
# Now create the table dictionary
msi_data = {"Shortcut": shortcut_table}
# Change some default MSI options and specify the
# use of the above defined tables
bdist_msi_options = {'data': msi_data}
# GUI applications require a different base on Windows (the default is for a
# console application).
base = None
target_name = 'pyjtt'
if sys.platform == "win32":
base = "Win32GUI"
options["build_exe"] = build_exe_options
options["bdist_msi"] = bdist_msi_options
target_name = 'pyjtt.exe'
elif sys.platform == "darwin":
bdist_mac_options = {
"bundle_name": NAME,
"iconfile": "resources/icons/icon.icns",
"include_resources": [
("resources/icons/start.ico", "resources/icons/start.ico"),
("resources/icons/stop.ico", "resources/icons/stop.ico"),
("resources/icons/icon-tray.png", "resources/icons/icon-tray.png"),
]
}
codesign_identity = os.environ.get("PYJTT_CODESIGN_IDENTITY")
if codesign_identity:
bdist_mac_options["codesign_identity"] = codesign_identity
codesign_entitlements = os.environ.get("PYJTT_CODESIGN_ENTITLEMENTS")
if codesign_entitlements:
bdist_mac_options["codesign_entitlements"] = codesign_entitlements
codesign_resource_rules = os.environ.get("PYJTT_CODESIGN_RESOURCE_RULES")
if codesign_resource_rules:
bdist_mac_options["codesign_resource_rules"] = codesign_resource_rules
options["bdist_mac"] = bdist_mac_options
target_app = os.path.join("pyjtt", "app.py")
setup(name="pyjtt",
version="1.2.4",
description="Jira Time Tracker",
maintainer="Nikolai Golub",
maintainer_email="nikolay.v.golub@gmail.com",
long_description="Allows track time in JIRA online and manage work logs",
license="GNU GENERAL PUBLIC LICENSE Version 3",
options=options,
executables=[Executable(target_app,
base=base,
targetName=target_name,
icon=icon_path,
shortcutName=NAME,
shortcutDir="DesktopFolder")])