File size: 3,166 Bytes
b2fbb41
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
124
125
126
127
128
129
# 导入模块
import os
import sys
from PyInstaller.utils.hooks import collect_data_files
import subprocess

# 获取提交哈希值
commit_hash = subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']).decode('utf-8').strip()  

# 构造带提交哈希值的版本号
version = "1.4.0.dev." + commit_hash

block_cipher = None

a = Analysis([
        'launch.py',
        ],
    pathex=[
        './scripts',
        ],
    binaries=[],
    datas=[
        ('.btrans_cache', './.btrans_cache'),
        ('config', './config'),
        ('data', './data'),
        ('doc', './doc'),
        ('fonts', './fonts'),
        ('icons', './icons'),
        ('modules', './modules'),
        ('scripts', './scripts'),
        ('translate', './translate'),
        ('ui', './ui'),
        ('utils', './utils'),
        ('venv/lib/python3.12/site-packages/spacy_pkuseg', './spacy_pkuseg'),
        ('venv/lib/python3.12/site-packages/torchvision', './torchvision'),
        ('venv/lib/python3.12/site-packages/translators', './translators'),
        ('venv/lib/python3.12/site-packages/cryptography', './cryptography'),
        ],
    hiddenimports=[
        'PyQt6',
        'numpy',
        'urllib3',
        'jaconv',
        'torch',
        'torchvision',
        'transformers',
        'fugashi',
        'unidic_lite',
        'tqdm',
        'shapely',
        'pyclipper',
        'einops',
        'termcolor',
        'bs4',
        'deepl',
        'qtpy',
        'sentencepiece',
        'ctranslate2',
        'docx2txt',
        'piexif',
        'keyboard',
        'requests',
        'colorama',
        'openai',
        'httpx',
        'langdetect',
        'srsly',
        'execjs',
        'pathos',
        ],
    hookspath=[],
    hooksconfig={},
    runtime_hooks=[],
    excludes=[],
    win_no_prefer_redirects=False,
    win_private_assemblies=False,
    cipher=block_cipher,
    noarchive=False,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)

exe = EXE(
    pyz,
    a.scripts,
    [],
    exclude_binaries=True,
    name='launch',
    debug=False,
    bootloader_ignore_signals=False,
    strip=False,
    upx=True,
    console=False,
    disable_windowed_traceback=False,
    argv_emulation=False,
    target_arch=None,
    codesign_identity=None,
    entitlements_file=None,
)
coll = COLLECT(
    exe,
    a.binaries,
    a.zipfiles,
    a.datas,
    strip=False,
    upx=True,
    upx_exclude=[],
    name='launch',
)
app = BUNDLE(
    coll,
    name='BallonsTranslator.app',
    icon='icons/icon.icns',
    bundle_identifier=None,
    info_plist={
        'CFBundleDisplayName': 'BallonsTranslator',
        'CFBundleName': 'BallonsTranslator',
        'CFBundlePackageType': 'APPL',
        'CFBundleSignature': 'BATR',
        'CFBundleShortVersionString': version,
        'CFBundleVersion': version,
        'CFBundleExecutable': 'launch',
        'CFBundleIconFile': 'icon.icns',
        'CFBundleIdentifier': 'dev.dmmaze.batr',
        'CFBundleInfoDictionaryVersion': '6.0',
        'LSApplicationCategoryType': 'public.app-category.graphics-design',
        'LSEnvironment': {'LANG': 'zh_CN.UTF-8'},
      }
)