新增:打包编译功能

This commit is contained in:
李强
2024-06-18 14:11:41 +08:00
parent 38bb65f9d5
commit 60ca268851

View File

@@ -1,12 +1,10 @@
# -*- mode: python ; coding: utf-8 -*-
block_cipher = None
a = Analysis(['main.py'],
a = Analysis(
['main.py'],
pathex=['./'],
binaries=[
],
binaries=[],
datas=[
('./static', 'static'),
('./static/captcha/fonts', 'captcha/fonts'),
@@ -43,15 +41,16 @@ a = Analysis(['main.py'],
"rest_framework_simplejwt.state",
],
hookspath=['./extra-hooks'],
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,
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
@@ -60,12 +59,25 @@ exe = EXE(pyz,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=True )
coll = COLLECT(exe,
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='main')
name='main',
)
app = BUNDLE(
coll,
name='main.app',
icon=None,
bundle_identifier=None,
)