update
This commit is contained in:
@@ -1,8 +1,4 @@
|
|||||||
# nas-media-player.spec
|
# nas-media-player.spec
|
||||||
# 使用方法:pyinstaller nas-media-player.spec
|
|
||||||
|
|
||||||
import sys
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
block_cipher = None
|
block_cipher = None
|
||||||
|
|
||||||
@@ -11,97 +7,25 @@ a = Analysis(
|
|||||||
pathex=[],
|
pathex=[],
|
||||||
binaries=[],
|
binaries=[],
|
||||||
datas=[],
|
datas=[],
|
||||||
|
|
||||||
hiddenimports=[
|
hiddenimports=[
|
||||||
# uvicorn 核心
|
|
||||||
'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',
|
||||||
'fastapi.routing',
|
|
||||||
'fastapi.middleware',
|
|
||||||
'fastapi.middleware.cors',
|
|
||||||
'fastapi.staticfiles',
|
|
||||||
'fastapi.responses',
|
|
||||||
'starlette',
|
'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',
|
||||||
'pydantic.v1',
|
'anyio',
|
||||||
'pydantic_core',
|
'aiofiles',
|
||||||
|
|
||||||
# 标准库补充
|
|
||||||
'multipart',
|
|
||||||
'python_multipart',
|
'python_multipart',
|
||||||
'email.mime.multipart',
|
|
||||||
'email.mime.text',
|
|
||||||
|
|
||||||
# 编码/哈希
|
|
||||||
'hashlib',
|
|
||||||
'hmac',
|
|
||||||
|
|
||||||
# 其他
|
|
||||||
'click',
|
|
||||||
'typing_extensions',
|
|
||||||
],
|
],
|
||||||
|
|
||||||
hookspath=[],
|
hookspath=[],
|
||||||
hooksconfig={},
|
|
||||||
runtime_hooks=[],
|
runtime_hooks=[],
|
||||||
|
|
||||||
excludes=[
|
excludes=[
|
||||||
# 排除不需要的大型库,减小体积
|
|
||||||
'tkinter',
|
'tkinter',
|
||||||
'matplotlib',
|
'matplotlib',
|
||||||
'numpy',
|
'numpy',
|
||||||
'pandas',
|
'pandas',
|
||||||
'PIL',
|
|
||||||
'scipy',
|
'scipy',
|
||||||
'IPython',
|
'IPython',
|
||||||
'jupyter',
|
'jupyter',
|
||||||
@@ -109,10 +33,8 @@ a = Analysis(
|
|||||||
'test',
|
'test',
|
||||||
'unittest',
|
'unittest',
|
||||||
],
|
],
|
||||||
win_no_prefer_redirects=False,
|
|
||||||
win_private_assemblies=False,
|
|
||||||
cipher=block_cipher,
|
cipher=block_cipher,
|
||||||
noarchive=False,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
|
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
|
||||||
@@ -123,18 +45,15 @@ exe = EXE(
|
|||||||
a.binaries,
|
a.binaries,
|
||||||
a.zipfiles,
|
a.zipfiles,
|
||||||
a.datas,
|
a.datas,
|
||||||
|
|
||||||
[],
|
[],
|
||||||
name='nas-media-player', # 输出的二进制名
|
name='nas-media-player',
|
||||||
|
|
||||||
debug=False,
|
debug=False,
|
||||||
bootloader_ignore_signals=False,
|
|
||||||
strip=True, # strip 调试符号,减小体积
|
strip=True,
|
||||||
upx=True, # 若系统有 upx 则进一步压缩
|
|
||||||
upx_exclude=[],
|
upx=False,
|
||||||
runtime_tmpdir=None,
|
|
||||||
console=True,
|
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