update
This commit is contained in:
@@ -1,8 +1,4 @@
|
||||
# nas-media-player.spec
|
||||
# 使用方法:pyinstaller nas-media-player.spec
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
block_cipher = None
|
||||
|
||||
@@ -11,97 +7,25 @@ a = Analysis(
|
||||
pathex=[],
|
||||
binaries=[],
|
||||
datas=[],
|
||||
|
||||
hiddenimports=[
|
||||
# uvicorn 核心
|
||||
'uvicorn',
|
||||
'uvicorn.main',
|
||||
'uvicorn.config',
|
||||
'uvicorn.server',
|
||||
'uvicorn.loops',
|
||||
'uvicorn.loops.auto',
|
||||
'uvicorn.loops.asyncio',
|
||||
'uvicorn.protocols',
|
||||
'uvicorn.protocols.http',
|
||||
'uvicorn.protocols.http.auto',
|
||||
'uvicorn.protocols.http.h11_impl',
|
||||
'uvicorn.protocols.http.httptools_impl',
|
||||
'uvicorn.protocols.websockets',
|
||||
'uvicorn.protocols.websockets.auto',
|
||||
'uvicorn.protocols.websockets.websockets_impl',
|
||||
'uvicorn.protocols.websockets.wsproto_impl',
|
||||
'uvicorn.lifespan',
|
||||
'uvicorn.lifespan.off',
|
||||
'uvicorn.lifespan.on',
|
||||
'uvicorn.logging',
|
||||
'uvicorn.middleware',
|
||||
'uvicorn.middleware.asgi2',
|
||||
'uvicorn.middleware.message_logger',
|
||||
'uvicorn.middleware.proxy_headers',
|
||||
|
||||
# fastapi / starlette
|
||||
'fastapi',
|
||||
'fastapi.routing',
|
||||
'fastapi.middleware',
|
||||
'fastapi.middleware.cors',
|
||||
'fastapi.staticfiles',
|
||||
'fastapi.responses',
|
||||
'starlette',
|
||||
'starlette.routing',
|
||||
'starlette.middleware',
|
||||
'starlette.middleware.cors',
|
||||
'starlette.staticfiles',
|
||||
'starlette.responses',
|
||||
'starlette.background',
|
||||
'starlette.concurrency',
|
||||
'starlette.datastructures',
|
||||
'starlette.exceptions',
|
||||
'starlette.formparsers',
|
||||
'starlette.requests',
|
||||
'starlette.types',
|
||||
'starlette.websockets',
|
||||
|
||||
# HTTP 解析库(uvicorn 可选依赖,打包时都带上)
|
||||
'h11',
|
||||
'httptools',
|
||||
'anyio',
|
||||
'anyio._backends._asyncio',
|
||||
'anyio._backends._trio',
|
||||
'sniffio',
|
||||
|
||||
# aiofiles
|
||||
'aiofiles',
|
||||
'aiofiles.os',
|
||||
'aiofiles.threadpool',
|
||||
|
||||
# pydantic(fastapi 依赖)
|
||||
'pydantic',
|
||||
'pydantic.v1',
|
||||
'pydantic_core',
|
||||
|
||||
# 标准库补充
|
||||
'multipart',
|
||||
'anyio',
|
||||
'aiofiles',
|
||||
'python_multipart',
|
||||
'email.mime.multipart',
|
||||
'email.mime.text',
|
||||
|
||||
# 编码/哈希
|
||||
'hashlib',
|
||||
'hmac',
|
||||
|
||||
# 其他
|
||||
'click',
|
||||
'typing_extensions',
|
||||
],
|
||||
|
||||
hookspath=[],
|
||||
hooksconfig={},
|
||||
runtime_hooks=[],
|
||||
|
||||
excludes=[
|
||||
# 排除不需要的大型库,减小体积
|
||||
'tkinter',
|
||||
'matplotlib',
|
||||
'numpy',
|
||||
'pandas',
|
||||
'PIL',
|
||||
'scipy',
|
||||
'IPython',
|
||||
'jupyter',
|
||||
@@ -109,10 +33,8 @@ a = Analysis(
|
||||
'test',
|
||||
'unittest',
|
||||
],
|
||||
win_no_prefer_redirects=False,
|
||||
win_private_assemblies=False,
|
||||
|
||||
cipher=block_cipher,
|
||||
noarchive=False,
|
||||
)
|
||||
|
||||
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
|
||||
@@ -123,18 +45,15 @@ exe = EXE(
|
||||
a.binaries,
|
||||
a.zipfiles,
|
||||
a.datas,
|
||||
|
||||
[],
|
||||
name='nas-media-player', # 输出的二进制名
|
||||
name='nas-media-player',
|
||||
|
||||
debug=False,
|
||||
bootloader_ignore_signals=False,
|
||||
strip=True, # strip 调试符号,减小体积
|
||||
upx=True, # 若系统有 upx 则进一步压缩
|
||||
upx_exclude=[],
|
||||
runtime_tmpdir=None,
|
||||
|
||||
strip=True,
|
||||
|
||||
upx=False,
|
||||
|
||||
console=True,
|
||||
disable_windowed_traceback=False,
|
||||
argv_emulation=False,
|
||||
target_arch=None,
|
||||
codesign_identity=None,
|
||||
entitlements_file=None,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user