update
This commit is contained in:
14
full.spec
14
full.spec
@@ -1,16 +1,18 @@
|
||||
# -*- mode: python ; coding: utf-8 -*-
|
||||
import os
|
||||
from PyInstaller.utils.hooks import collect_all
|
||||
from PyInstaller.utils.hooks import collect_all, copy_metadata
|
||||
import docutranslate
|
||||
|
||||
# 初始化列表
|
||||
datas = []
|
||||
binaries = []
|
||||
hiddenimports = ['markdown.extensions.tables', 'pymdownx.arithmatex',
|
||||
'pymdownx.superfences', 'pymdownx.highlight', 'pygments']
|
||||
'pymdownx.superfences', 'pymdownx.highlight', 'pygments',
|
||||
'docling_ibm_models',
|
||||
'docling_parse','cv2']
|
||||
|
||||
# 先收集第三方包的资源
|
||||
for package in ['easyocr', 'docling', 'pygments']:
|
||||
for package in ['easyocr', 'docling', 'pygments', 'docling_ibm_models']:
|
||||
try:
|
||||
tmp_ret = collect_all(package)
|
||||
datas += tmp_ret[0]
|
||||
@@ -19,6 +21,12 @@ for package in ['easyocr', 'docling', 'pygments']:
|
||||
except Exception as e:
|
||||
print(f"Warning: Failed to collect resources for {package}: {e}")
|
||||
|
||||
try:
|
||||
datas += copy_metadata('docling-ibm-models') # 这里必须用连字符(pip名)
|
||||
datas += copy_metadata('docling-parse') # 预防性添加
|
||||
except Exception as e:
|
||||
print(f"Warning: Failed to copy metadata: {e}")
|
||||
|
||||
# 然后添加您的自定义资源(避免重复)
|
||||
custom_datas = [
|
||||
('./.venv/Lib/site-packages/docling_parse/pdf_resources_v2', 'docling_parse/pdf_resources_v2'),
|
||||
|
||||
@@ -20,14 +20,15 @@ dependencies = [
|
||||
"pysubs2>=1.8.0",
|
||||
"httpx>=0.28.1",
|
||||
"python-pptx>=1.0.2",
|
||||
|
||||
]
|
||||
dynamic = ["version"]
|
||||
|
||||
[project.optional-dependencies]
|
||||
docling = ["opencv-python>=4.11.0.86", "docling>=2.40.0", "hf-xet>=1.1.10"]
|
||||
docling = ["opencv-python>=4.12.0.88", "docling>=2.40.0", "hf-xet>=1.1.10"]
|
||||
|
||||
[dependency-groups]
|
||||
dev = ["opencv-python>=4.11.0.86", "docling>=2.40.0", "hf-xet>=1.1.10"]
|
||||
dev = ["opencv-python>=4.12.0.88","docling>=2.40.0", "hf-xet>=1.1.10"]
|
||||
[project.scripts]
|
||||
docutranslate = "docutranslate.cli:main"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user