install_and_run.bat to install svg-polish correctly in case of "new" standalone. Added requirements of packages in requirements-dev.txt and requirement.txt

This commit is contained in:
2026-06-17 10:46:39 +02:00
parent e6a8fcb963
commit 16f30e8d38
3 changed files with 34 additions and 5 deletions
+30 -5
View File
@@ -12,7 +12,7 @@ set "SELF_DIR=%~dp0"
set "SCRIPT=%SELF_DIR%pptx_image_compress.py" set "SCRIPT=%SELF_DIR%pptx_image_compress.py"
rem ---- Python Embeddable config ---- rem ---- Python Embeddable config ----
set "PY_EMBED_VERSION=3.14.5" set "PY_EMBED_VERSION=3.14.6"
set "PY_EMBED_ZIP=python-%PY_EMBED_VERSION%-embed-amd64.zip" set "PY_EMBED_ZIP=python-%PY_EMBED_VERSION%-embed-amd64.zip"
set "PY_EMBED_URL=https://www.python.org/ftp/python/%PY_EMBED_VERSION%/%PY_EMBED_ZIP%" set "PY_EMBED_URL=https://www.python.org/ftp/python/%PY_EMBED_VERSION%/%PY_EMBED_ZIP%"
set "PY_DIR=%SELF_DIR%python-embed" set "PY_DIR=%SELF_DIR%python-embed"
@@ -110,6 +110,14 @@ if errorlevel 1 (
) )
set "PY_CMD=%PY_EXE%" set "PY_CMD=%PY_EXE%"
rem ---- Fix embedded Python isolation for the installation of pip ----
set "PTH_FILE=%PY_DIR%\python314._pth"
if exist "%PTH_FILE%" (
echo [INFO] Enabling site-packages in embedded Python...
powershell -Command ^
"(Get-Content '%PTH_FILE%') -replace '^#?\s*import site','import site' | Set-Content '%PTH_FILE%'"
)
:have_python :have_python
if not defined PY_CMD ( if not defined PY_CMD (
echo [ERROR] Konnte Python nicht ermitteln. Abbruch. echo [ERROR] Konnte Python nicht ermitteln. Abbruch.
@@ -122,8 +130,17 @@ if not exist "%SCRIPT%" (
exit /b 6 exit /b 6
) )
set "RUN_ARGS=%*" set "ALL_ARGS=%*"
if "%~1"=="" set "RUN_ARGS=-h" set "RUN_ARGS=%ALL_ARGS%"
set "DEBUG_MODE=0"
if "%~1"=="--debug" (
set "DEBUG_MODE=1"
set "RUN_ARGS=!ALL_ARGS:~8!"
if "!RUN_ARGS:~0,1!"==" " set "RUN_ARGS=!RUN_ARGS:~1!"
)
if "!RUN_ARGS!"=="" set "RUN_ARGS=-h"
echo [INFO] Pruefe und installiere Python-Abhaengigkeit: svg-polish ... echo [INFO] Pruefe und installiere Python-Abhaengigkeit: svg-polish ...
set "PIP_OK=0" set "PIP_OK=0"
@@ -165,14 +182,22 @@ if "%PIP_OK%"=="0" (
if "%PIP_OK%"=="1" ( if "%PIP_OK%"=="1" (
if defined USE_PY_LAUNCHER ( if defined USE_PY_LAUNCHER (
"%PY_CMD%" -3 -m pip install --disable-pip-version-check --quiet svg-polish "%PY_CMD%" -3 -m pip install --disable-pip-version-check --quiet --no-warn-script-location svg-polish
) else ( ) else (
"%PY_CMD%" -m pip install --disable-pip-version-check --quiet svg-polish "%PY_CMD%" -m pip install --disable-pip-version-check --quiet --no-warn-script-location svg-polish
) )
if errorlevel 1 ( if errorlevel 1 (
echo [WARN] 'svg-polish' konnte nicht installiert werden. SVG-Dateien werden nicht komprimiert. echo [WARN] 'svg-polish' konnte nicht installiert werden. SVG-Dateien werden nicht komprimiert.
) else ( ) else (
echo [OK] 'svg-polish' ist verfuegbar. echo [OK] 'svg-polish' ist verfuegbar.
if %DEBUG_MODE%==1 (
echo [DEBUG] pip list:
if defined USE_PY_LAUNCHER (
"%PY_CMD%" -3 -m pip list
) else (
"%PY_CMD%" -m pip list
)
)
) )
) else ( ) else (
echo [WARN] pip konnte nicht eingerichtet werden. SVG-Dateien werden nicht komprimiert. echo [WARN] pip konnte nicht eingerichtet werden. SVG-Dateien werden nicht komprimiert.
+3
View File
@@ -0,0 +1,3 @@
svg-polish==1.0.0
pytest==9.0.3
pytest-cov==7.1.0
+1
View File
@@ -0,0 +1 @@
svg-polish==1.0.0