打包文件

This commit is contained in:
杍超
2025-01-22 10:43:53 +08:00
parent e168d13c0a
commit b876e5927f
5 changed files with 499 additions and 471 deletions

28
update_version.py Normal file
View File

@@ -0,0 +1,28 @@
import subprocess
import os
import glob
import shutil
# 移除 gradio_webrtc 包
subprocess.run(['pip', 'uninstall', '-y', 'gradio_webrtc'])
# 删除已有的 dist 目录
if os.path.exists('dist'):
shutil.rmtree('dist')
# 执行 gradio cc install
subprocess.run(['gradio', 'cc', 'install'])
# 执行 gradio cc build --no-generate-docs
subprocess.run(['gradio', 'cc', 'build', '--no-generate-docs'])
# 查找 dist 目录下的 .whl 文件
whl_files = glob.glob('dist/*.whl')
if whl_files:
whl_file = whl_files[0]
# 安装 .whl 文件
subprocess.run(['pip', 'install', whl_file])
else:
print("没有找到 .whl 文件")