# -*- mode: python ; coding: utf-8 -*- # Worker 打包配置(供客户端 GUI 的「启动」按钮调用) # 用法: pyinstaller build_worker.spec # 将生成的 worker.exe 放入「BOSS直聘Worker客户端」输出目录 block_cipher = None import os _project_root = os.path.dirname(os.path.abspath(SPECPATH)) a = Analysis( [os.path.join(_project_root, 'worker', 'main.py')], pathex=[_project_root], binaries=[], datas=[ (os.path.join(_project_root, '1.py'), '.'), ], hiddenimports=[ 'worker', 'worker.ws_client', 'worker.bit_browser', 'worker.browser_control', 'worker.tasks', 'worker.tasks.registry', 'worker.tasks.base', 'worker.tasks.boss_recruit', 'worker.tasks.check_login', 'tunnel', 'tunnel.client', 'tunnel.protocol', 'common', 'common.protocol', ], 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='worker', debug=False, bootloader_ignore_signals=False, strip=False, upx=True, console=True, # Worker 需要控制台输出 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='worker', )