-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
47 lines (41 loc) · 1.61 KB
/
setup.py
File metadata and controls
47 lines (41 loc) · 1.61 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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
from cx_Freeze import setup, Executable
from main import app_definitions
from pathlib import Path
# https://cx-freeze.readthedocs.io/en/stable/setup_script.html
# Dependencies are automatically detected, but it might need fine tuning.
build_exe_options = {
"packages": ["scipy", "numpy"], # RecursionError in cx_Freeze if these are not provided
"include_files": [
(str(Path("LICENSE")), str(Path("LICENSE"))),
(str(Path("README.md")), str(Path("README.md"))),
(str(Path(app_definitions["icon_path"])), str(Path(app_definitions["icon_path"]))),
],
"silent_level": 1,
}
bdist_msi_options = {
"extensions": [{"extension": "lc",
"verb": "load",
"argument": '"%1"',
"executable": "main.exe",
}]
}
# base="Win32GUI" should be used only for Windows GUI app
base = "Win32GUI" if sys.platform == "win32" else None
executables=[Executable("main.py",
copyright=app_definitions["copyright"],
base=base,
shortcut_name=app_definitions["app_name"] + " v" + app_definitions["version"],
shortcut_dir="DesktopFolder",
icon=app_definitions["icon_path"],
),
]
setup(
name=app_definitions["app_name"],
version=app_definitions["version"],
description=app_definitions["description"],
options={"build_exe": build_exe_options, "bdist_msi": bdist_msi_options},
executables=executables,
)