diff --git a/.gitignore b/.gitignore index 62f728f..2ec1858 100644 --- a/.gitignore +++ b/.gitignore @@ -6,9 +6,8 @@ delivery/languagetool/ delivery/ollama/ delivery/wheelhouse/ delivery/logs/ -# копии исходников внутри комплекта (источник — корень репо) +# копия исходника внутри комплекта (источник — корень репо) delivery/app.py -delivery/requirements.txt # генерируемые артефакты samples/ static/.DS_Store diff --git a/delivery/install.bat b/delivery/install.bat index bff237f..3d543e0 100644 --- a/delivery/install.bat +++ b/delivery/install.bat @@ -2,13 +2,30 @@ REM One-time install: Python (current user) + deps (wheelhouse or PyPI). cd /d %~dp0 echo [1/2] Python setup (quiet, current user), takes ~1 min... -python-3.12.10-amd64.exe /quiet InstallAllUsers=0 PrependPath=1 Include_launcher=0 Include_test=0 -echo [2/2] Python dependencies... -"%LocalAppData%\Programs\Python\Python312\python.exe" -m venv venv -if exist wheelhouse ( - venv\Scripts\python.exe -m pip install --no-index --find-links wheelhouse -r requirements.txt +if exist python-3.12.10-amd64.exe ( + python-3.12.10-amd64.exe /quiet InstallAllUsers=0 PrependPath=1 Include_launcher=0 Include_test=0 ) else ( - venv\Scripts\python.exe -m pip install -r requirements.txt + echo Python installer not found here - skipping, expecting Python already installed... +) +echo [2/2] Python dependencies... +set "REQ=requirements.txt" +if not exist "%REQ%" set "REQ=..\requirements.txt" +if not exist "%REQ%" ( + echo ERROR: requirements.txt not found in delivery or parent folder + if /i not "%~1"=="NOPAUSE" pause + exit /b 1 +) +if not exist venv\Scripts\python.exe ( + "%LocalAppData%\Programs\Python\Python312\python.exe" -m venv venv || ( + echo ERROR: failed to create venv - is Python installed? + if /i not "%~1"=="NOPAUSE" pause + exit /b 1 + ) +) +if exist wheelhouse ( + venv\Scripts\python.exe -m pip install --no-index --find-links wheelhouse -r "%REQ%" +) else ( + venv\Scripts\python.exe -m pip install -r "%REQ%" ) echo Done. if /i not "%~1"=="NOPAUSE" pause diff --git a/delivery/requirements.txt b/delivery/requirements.txt new file mode 100644 index 0000000..98a0184 --- /dev/null +++ b/delivery/requirements.txt @@ -0,0 +1,5 @@ +fastapi +uvicorn +httpx +python-docx +python-multipart \ No newline at end of file