-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup_cx.py
More file actions
113 lines (109 loc) · 2.95 KB
/
setup_cx.py
File metadata and controls
113 lines (109 loc) · 2.95 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
import sys
from cx_Freeze import setup, Executable
import os
# Build options for cx_Freeze
build_exe_options = {
"packages": [
# Core packages
"serial",
"serial.tools",
"serial.tools.list_ports",
"serial.serialwin32",
"serial.win32",
"serial.serialutil",
"serial.threaded",
"serial.urlhandler",
# PyQt6 packages
"PyQt6",
"PyQt6.QtCore",
"PyQt6.QtGui",
"PyQt6.QtWidgets",
# Async packages
"qasync",
# Core application packages
"core",
"core.arduino",
"core.input_mapper",
"core.xplane_connection",
"core.hid_manager",
"core.variable_store",
"core.dataref_manager",
# GUI packages
"gui",
"gui.widgets",
# Utility packages
"utils",
# Standard library packages often needed
"json",
"logging",
"asyncio",
"re",
"pathlib",
"typing",
"os",
"sys",
"time",
"threading",
"queue",
"collections",
"dataclasses",
],
"includes": [
# Explicit includes for serial backends
"serial.serialutil",
"serial.threaded",
"serial.urlhandler.protocol_socket",
"serial.urlhandler.protocol_rfc2217",
"serial.urlhandler.protocol_loop",
"serial.urlhandler.protocol_alt",
"serial.urlhandler.protocol_cp2110",
"serial.urlhandler.protocol_hwgrep",
"serial.urlhandler.protocol_spy",
# Windows-specific serial modules
"serial.serialwin32",
"serial.win32",
"serial.tools.list_ports_windows",
# Additional modules that might be missed
"requests",
"aiohttp",
"websockets",
"lxml",
"bs4",
],
"excludes": [
# Exclude modules that are not needed for Windows
"tkinter", # If not using tkinter
],
"include_files": [
# Include resources directory
("resources", "resources"),
# Include dataref database
("resources/dataref_database.json", "resources/dataref_database.json"),
# Include any other necessary files
("runtime_hooks", "runtime_hooks"),
],
"optimize": 0,
}
# For Windows GUI application without console
if sys.platform == "win32":
base = "gui" # Use 'gui' for Windows GUI applications without console
else:
base = None
executables = [
Executable(
"main.py",
base=base,
target_name="X-Plane Dataref Bridge.exe",
icon="resources/icon.ico",
shortcut_name="X-Plane Dataref Bridge",
shortcut_dir="ProgramMenuFolder",
)
]
setup(
name="X-Plane Dataref Bridge",
version="1.0.0",
description="X-Plane Dataref Bridge - Connect X-Plane to Arduino Hardware",
author="X-Plane Dataref Bridge Team",
options={"build_exe": build_exe_options},
executables=executables,
)