-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
89 lines (76 loc) · 3.05 KB
/
setup.py
File metadata and controls
89 lines (76 loc) · 3.05 KB
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
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Python 3
import sys, os
from cx_Freeze import setup, Executable
APPNAME = 'ihesync'
APPDESCR = 'Synchronize published documents on ihe.net website locally.'
MAIN = 'ihesync/ui/app.py'
APP_ICON = f'{APPNAME}/ui/img/ihesync.ico'
APP_ICNS = f'{APPNAME}/ui/img/ihesync.icns'
__version__ = '2.1'
__author__ = "Frederic Laurent"
#############################################################################
# preparation des options
# chemins de recherche des modules
# ajouter d'autres chemins (absolus) si necessaire: sys.path + ["chemin1", "chemin2"]
path = sys.path + ["ihesync", "ihesync/ui"]
# options d'inclusion/exclusion des modules
includes = [] # nommer les modules non trouves par cx_freeze
excludes = []
packages = [] # nommer les packages utilises
buildOptions = dict(packages=["multiprocessing"], excludes=["tkinter"])
winOptions = {"upgrade-code": "44aad47f-38bd-4fcf-b70c-b0b4cf3f246b",
"initial_target_dir": r'[ProgramFilesFolder]\%s' % APPNAME,
"install_icon": APP_ICON,
"target_name": APPNAME}
macOptions = {"iconfile": APP_ICNS, "custom_info_plist": "Info.plist"}
dmgOptions = {"volume_label": APPNAME, "applications_shortcut": True}
# copier les fichiers non-Python et/ou repertoires et leur contenu:
includefiles = []
binpathincludes = []
if sys.platform == "linux":
binpathincludes += ["/usr/lib"]
# niveau d'optimisation pour la compilation en bytecodes
optimize = 0
# si True, n'affiche que les warning et les erreurs pendant le traitement cx_freeze
silent = True
if sys.platform == "win32":
# options["include_msvcr"] = True
buildOptions["include_msvcr"] = True
setup(
name=APPNAME,
version=__version__,
description=APPDESCR,
packages=[APPNAME],
options={"build_exe": buildOptions, "sdist_msi": winOptions},
executables=[Executable(MAIN, base="Win32GUI", targetName=APPNAME, icon=APP_ICON)],
author=__author__,
)
elif sys.platform == "linux":
setup(
name=APPNAME,
version=__version__,
description=APPDESCR,
packages=[APPNAME],
options={"build_exe": buildOptions},
executables=[Executable(MAIN, base=None, targetName=APPNAME, icon=APP_ICON)],
entry_points={'console_scripts': ['ihesync=ihesync.ui.app:main']},
data_files=[('share/applications', [f'{APPNAME}.desktop'])],
classifiers=["License :: OSI Approved :: BSD License"],
author=__author__,
)
# includefiles += [...] : ajouter les recopies specifiques à Linux
elif sys.platform == "darwin":
setup(name=APPNAME,
version=__version__,
description=APPDESCR,
packages=[APPNAME],
options={"build_exe": buildOptions, "bdist_mac": macOptions, "bdist_dmg": dmgOptions},
executables=[Executable(MAIN, base=None, targetName=APPNAME, icon=APP_ICON)],
)
else:
pass
# includefiles += [...] : cas du Mac OSX non traite ici
# On Mac OS
# python setup.py bdist_mac --iconfile=assets/banana.icns --custom-info-plist=Info.plist