-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.spec
More file actions
123 lines (103 loc) · 3.31 KB
/
Copy pathapp.spec
File metadata and controls
123 lines (103 loc) · 3.31 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
114
115
116
117
118
119
120
121
122
123
# -*- mode: python ; coding: utf-8 -*-
"""PyInstaller spec for RNMR - Media File Renamer.
Usage:
pyinstaller app.spec
Output:
dist/RNMR.exe
Notes:
- Place ffprobe.exe in resources/ before building to bundle it.
- If resources/ffprobe.exe is absent the build still succeeds;
ffprobe features will fall back to PATH lookup at runtime.
"""
import os
# ---------------------------------------------------------------------------
# Paths
# ---------------------------------------------------------------------------
SPEC_DIR = os.path.abspath(SPECPATH)
RESOURCES_DIR = os.path.join(SPEC_DIR, "resources")
# ---------------------------------------------------------------------------
# Data files
# ---------------------------------------------------------------------------
datas = []
# Bundle the resources directory (icons, etc.)
if os.path.isdir(RESOURCES_DIR):
datas.append((RESOURCES_DIR, "resources"))
# Bundle LICENSE_FFMPEG.txt alongside the executable (if present)
_license_ffmpeg = os.path.join(SPEC_DIR, "LICENSE_FFMPEG.txt")
if os.path.isfile(_license_ffmpeg):
datas.append((_license_ffmpeg, "."))
# ---------------------------------------------------------------------------
# Binaries
# ---------------------------------------------------------------------------
binaries = []
# Bundle ffprobe.exe as a binary in resources/ (if present)
_ffprobe = os.path.join(RESOURCES_DIR, "ffprobe.exe")
if os.path.isfile(_ffprobe):
binaries.append((_ffprobe, "resources"))
# ---------------------------------------------------------------------------
# Hidden imports
# ---------------------------------------------------------------------------
hiddenimports = [
# Keep Qt modules explicit to avoid pulling in the entire Qt stack.
"PySide6.QtCore",
"PySide6.QtGui",
"PySide6.QtWidgets",
"PySide6.QtNetwork",
# Third-party
"requests",
"urllib3",
"charset_normalizer",
"certifi",
"idna",
"dotenv",
]
# ---------------------------------------------------------------------------
# Analysis
# ---------------------------------------------------------------------------
a = Analysis(
["gui/main.py"],
pathex=[SPEC_DIR],
binaries=binaries,
datas=datas,
hiddenimports=hiddenimports,
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[
"tkinter",
"unittest",
"test",
"xmlrpc",
"pydoc",
# RNMR has no cryptography features; HTTPS to TMDB goes through the
# standard ssl module. Excluding it keeps the bundle smaller and
# avoids pulling an unrelated (and sometimes broken) dependency.
"cryptography",
],
noarchive=False,
)
# ---------------------------------------------------------------------------
# Build
# ---------------------------------------------------------------------------
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name="RNMR",
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=False, # windowed mode -- no console
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=os.path.join(RESOURCES_DIR, "rnmr.ico"),
)