Update build configs and dependencies
Browse files- MedicalTranscriber.spec +44 -0
- build_windows.spec +6 -2
- build_with_uv.py +61 -0
- pyproject.toml +4 -1
- simple_build.py +59 -0
- uv.lock +0 -0
MedicalTranscriber.spec
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# -*- mode: python ; coding: utf-8 -*-
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
a = Analysis(
|
| 5 |
+
['run_gui.py'],
|
| 6 |
+
pathex=[],
|
| 7 |
+
binaries=[],
|
| 8 |
+
datas=[('medical_terms.txt', '.'), ('app_config.json', '.'), ('pipeline', 'pipeline'), ('app', 'app'), ('corrector', 'corrector'), ('stt', 'stt'), ('knowledge_base', 'knowledge_base'), ('common', 'common')],
|
| 9 |
+
hiddenimports=['PyQt6', 'PyQt6.QtGui', 'PyQt6.QtCore', 'PyQt6.QtWidgets', 'transformers', 'torch', 'librosa', 'soundfile', 'numpy', 'docx', 'requests'],
|
| 10 |
+
hookspath=[],
|
| 11 |
+
hooksconfig={},
|
| 12 |
+
runtime_hooks=[],
|
| 13 |
+
excludes=['matplotlib', 'tensorboard', 'pytest', 'IPython'],
|
| 14 |
+
noarchive=False,
|
| 15 |
+
optimize=0,
|
| 16 |
+
)
|
| 17 |
+
pyz = PYZ(a.pure)
|
| 18 |
+
|
| 19 |
+
exe = EXE(
|
| 20 |
+
pyz,
|
| 21 |
+
a.scripts,
|
| 22 |
+
[],
|
| 23 |
+
exclude_binaries=True,
|
| 24 |
+
name='MedicalTranscriber',
|
| 25 |
+
debug=False,
|
| 26 |
+
bootloader_ignore_signals=False,
|
| 27 |
+
strip=False,
|
| 28 |
+
upx=True,
|
| 29 |
+
console=False,
|
| 30 |
+
disable_windowed_traceback=False,
|
| 31 |
+
argv_emulation=False,
|
| 32 |
+
target_arch=None,
|
| 33 |
+
codesign_identity=None,
|
| 34 |
+
entitlements_file=None,
|
| 35 |
+
)
|
| 36 |
+
coll = COLLECT(
|
| 37 |
+
exe,
|
| 38 |
+
a.binaries,
|
| 39 |
+
a.datas,
|
| 40 |
+
strip=False,
|
| 41 |
+
upx=True,
|
| 42 |
+
upx_exclude=[],
|
| 43 |
+
name='MedicalTranscriber',
|
| 44 |
+
)
|
build_windows.spec
CHANGED
|
@@ -8,7 +8,11 @@ import os
|
|
| 8 |
from pathlib import Path
|
| 9 |
|
| 10 |
# Получить корневую папку проекта
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
block_cipher = None
|
| 14 |
|
|
@@ -18,7 +22,7 @@ a = Analysis(
|
|
| 18 |
binaries=[],
|
| 19 |
datas=[
|
| 20 |
(str(root_dir / 'medical_terms.txt'), '.'),
|
| 21 |
-
(str(root_dir / '
|
| 22 |
(str(root_dir / 'pipeline'), 'pipeline'),
|
| 23 |
(str(root_dir / 'app'), 'app'),
|
| 24 |
(str(root_dir / 'corrector'), 'corrector'),
|
|
|
|
| 8 |
from pathlib import Path
|
| 9 |
|
| 10 |
# Получить корневую папку проекта
|
| 11 |
+
# В PyInstaller SPECPATH - это полный путь к spec файлу
|
| 12 |
+
if 'SPECPATH' in globals():
|
| 13 |
+
root_dir = Path(SPECPATH).parent
|
| 14 |
+
else:
|
| 15 |
+
root_dir = Path(__file__).parent.absolute()
|
| 16 |
|
| 17 |
block_cipher = None
|
| 18 |
|
|
|
|
| 22 |
binaries=[],
|
| 23 |
datas=[
|
| 24 |
(str(root_dir / 'medical_terms.txt'), '.'),
|
| 25 |
+
(str(root_dir / 'app_config.json'), '.'),
|
| 26 |
(str(root_dir / 'pipeline'), 'pipeline'),
|
| 27 |
(str(root_dir / 'app'), 'app'),
|
| 28 |
(str(root_dir / 'corrector'), 'corrector'),
|
build_with_uv.py
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""
|
| 3 |
+
Скрипт сборки через uv
|
| 4 |
+
"""
|
| 5 |
+
import subprocess
|
| 6 |
+
import os
|
| 7 |
+
|
| 8 |
+
project_dir = os.path.dirname(os.path.abspath(__file__))
|
| 9 |
+
os.chdir(project_dir)
|
| 10 |
+
|
| 11 |
+
print(f"Рабочая директория: {os.getcwd()}")
|
| 12 |
+
|
| 13 |
+
# Запустить PyInstaller через uv
|
| 14 |
+
print("\nЗапуск PyInstaller через uv...")
|
| 15 |
+
|
| 16 |
+
# На Linux/Mac используем : вместо ; для разделителя путей
|
| 17 |
+
separator = ":" if os.name != "nt" else ";"
|
| 18 |
+
|
| 19 |
+
cmd = [
|
| 20 |
+
"uv", "run",
|
| 21 |
+
"--with", "pyinstaller",
|
| 22 |
+
"pyinstaller",
|
| 23 |
+
"--clean",
|
| 24 |
+
"--noconfirm",
|
| 25 |
+
"--onedir",
|
| 26 |
+
"--windowed",
|
| 27 |
+
"--name=MedicalTranscriber",
|
| 28 |
+
f"--add-data=medical_terms.txt{separator}.",
|
| 29 |
+
f"--add-data=app_config.json{separator}.",
|
| 30 |
+
f"--add-data=pipeline{separator}pipeline",
|
| 31 |
+
f"--add-data=app{separator}app",
|
| 32 |
+
f"--add-data=corrector{separator}corrector",
|
| 33 |
+
f"--add-data=stt{separator}stt",
|
| 34 |
+
f"--add-data=knowledge_base{separator}knowledge_base",
|
| 35 |
+
f"--add-data=common{separator}common",
|
| 36 |
+
"--hidden-import=PyQt6",
|
| 37 |
+
"--hidden-import=PyQt6.QtGui",
|
| 38 |
+
"--hidden-import=PyQt6.QtCore",
|
| 39 |
+
"--hidden-import=PyQt6.QtWidgets",
|
| 40 |
+
"--hidden-import=transformers",
|
| 41 |
+
"--hidden-import=torch",
|
| 42 |
+
"--hidden-import=librosa",
|
| 43 |
+
"--hidden-import=soundfile",
|
| 44 |
+
"--hidden-import=numpy",
|
| 45 |
+
"--hidden-import=docx",
|
| 46 |
+
"--hidden-import=requests",
|
| 47 |
+
"--exclude-module=matplotlib",
|
| 48 |
+
"--exclude-module=tensorboard",
|
| 49 |
+
"--exclude-module=pytest",
|
| 50 |
+
"--exclude-module=IPython",
|
| 51 |
+
"run_gui.py"
|
| 52 |
+
]
|
| 53 |
+
|
| 54 |
+
print(f"Команда: {' '.join(cmd)}\n")
|
| 55 |
+
result = subprocess.run(cmd)
|
| 56 |
+
|
| 57 |
+
if result.returncode == 0:
|
| 58 |
+
print("\n✅ Сборка завершена успешно!")
|
| 59 |
+
print(f"Файл: {os.path.join(project_dir, 'dist', 'MedicalTranscriber')}")
|
| 60 |
+
else:
|
| 61 |
+
print(f"\n❌ Ошибка сборки (код {result.returncode})")
|
pyproject.toml
CHANGED
|
@@ -51,8 +51,11 @@ dev = [
|
|
| 51 |
requires = ["hatchling"]
|
| 52 |
build-backend = "hatchling.build"
|
| 53 |
|
|
|
|
|
|
|
|
|
|
| 54 |
[tool.uv]
|
| 55 |
# UV configuration for package management
|
| 56 |
-
index =
|
| 57 |
|
| 58 |
|
|
|
|
| 51 |
requires = ["hatchling"]
|
| 52 |
build-backend = "hatchling.build"
|
| 53 |
|
| 54 |
+
[tool.hatch.build.targets.wheel]
|
| 55 |
+
packages = ["app", "pipeline", "corrector", "stt", "knowledge_base", "common"]
|
| 56 |
+
|
| 57 |
[tool.uv]
|
| 58 |
# UV configuration for package management
|
| 59 |
+
index-url = "https://pypi.org/simple"
|
| 60 |
|
| 61 |
|
simple_build.py
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""
|
| 3 |
+
Простой скрипт для сборки exe
|
| 4 |
+
"""
|
| 5 |
+
import subprocess
|
| 6 |
+
import sys
|
| 7 |
+
import os
|
| 8 |
+
|
| 9 |
+
# Перейти в директорию проекта
|
| 10 |
+
project_dir = os.path.dirname(os.path.abspath(__file__))
|
| 11 |
+
os.chdir(project_dir)
|
| 12 |
+
|
| 13 |
+
print(f"Рабочая директория: {os.getcwd()}")
|
| 14 |
+
print(f"Python: {sys.executable}")
|
| 15 |
+
|
| 16 |
+
# Установить PyInstaller если нужно
|
| 17 |
+
print("\n1. Установка PyInstaller...")
|
| 18 |
+
subprocess.run([sys.executable, "-m", "pip", "install", "pyinstaller"], check=False)
|
| 19 |
+
|
| 20 |
+
# Запустить PyInstaller
|
| 21 |
+
print("\n2. Запуск PyInstaller...")
|
| 22 |
+
cmd = [
|
| 23 |
+
sys.executable, "-m", "PyInstaller",
|
| 24 |
+
"--clean",
|
| 25 |
+
"--noconfirm",
|
| 26 |
+
"--onefile",
|
| 27 |
+
"--windowed",
|
| 28 |
+
"--name=MedicalTranscriber",
|
| 29 |
+
"--add-data=medical_terms.txt:.",
|
| 30 |
+
"--add-data=app_config.json:.",
|
| 31 |
+
"--add-data=pipeline:pipeline",
|
| 32 |
+
"--add-data=app:app",
|
| 33 |
+
"--add-data=corrector:corrector",
|
| 34 |
+
"--add-data=stt:stt",
|
| 35 |
+
"--add-data=knowledge_base:knowledge_base",
|
| 36 |
+
"--add-data=common:common",
|
| 37 |
+
"--hidden-import=PyQt6",
|
| 38 |
+
"--hidden-import=PyQt6.QtGui",
|
| 39 |
+
"--hidden-import=PyQt6.QtCore",
|
| 40 |
+
"--hidden-import=PyQt6.QtWidgets",
|
| 41 |
+
"--hidden-import=transformers",
|
| 42 |
+
"--hidden-import=torch",
|
| 43 |
+
"--hidden-import=librosa",
|
| 44 |
+
"--hidden-import=soundfile",
|
| 45 |
+
"--hidden-import=numpy",
|
| 46 |
+
"--hidden-import=docx",
|
| 47 |
+
"--hidden-import=requests",
|
| 48 |
+
"run_gui.py"
|
| 49 |
+
]
|
| 50 |
+
|
| 51 |
+
print(f"Команда: {' '.join(cmd)}")
|
| 52 |
+
result = subprocess.run(cmd)
|
| 53 |
+
|
| 54 |
+
if result.returncode == 0:
|
| 55 |
+
print("\n✅ Сборка завершена успешно!")
|
| 56 |
+
print(f"Файл находится в: {os.path.join(project_dir, 'dist', 'MedicalTranscriber')}")
|
| 57 |
+
else:
|
| 58 |
+
print(f"\n❌ Ошибка сборки (код {result.returncode})")
|
| 59 |
+
sys.exit(1)
|
uv.lock
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|