trenne das Laden der .env pip libraries von dem Setzen der Umgebung. setenv.bat enthält jetzt bei Bedarf den python Interpreter auf dem Share
This commit is contained in:
+1
-1
@@ -7,4 +7,4 @@ REM Beispielaufruf mit Parametern:
|
||||
REM --in: Ordner mit .dxf-Dateien (optional. Standard: work/converted_dxfs)
|
||||
REM --name: Name der zu erzeugenden Bibliothek
|
||||
|
||||
python %PROJECT_LIB%\dxf2lib.py %*
|
||||
"%VIRTUAL_ENV%\Scripts\python.exe" %PROJECT_LIB%\dxf2lib.py %*
|
||||
|
||||
+24
-21
@@ -1,30 +1,33 @@
|
||||
@echo off
|
||||
CALL setenv.bat
|
||||
IF DEFINED NETWORK_INTERPRETER_PATH (
|
||||
goto %~1_network
|
||||
|
||||
IF /I "%1"=="activate" GOTO activate
|
||||
IF /I "%1"=="deactivate" GOTO deactivate
|
||||
GOTO :eof
|
||||
|
||||
|
||||
:activate
|
||||
REM Interpreter wählen
|
||||
IF DEFINED NETWORK_PYTHON (
|
||||
SET PYTHON_EXE=%NETWORK_PYTHON%\python.exe
|
||||
) ELSE (
|
||||
goto %~1_local
|
||||
SET PYTHON_EXE=python
|
||||
)
|
||||
|
||||
:activate_interpreter_local
|
||||
IF NOT EXIST %PROJECT%\.venv CALL %PROJECT_BIN%\install_py.bat
|
||||
CALL %PROJECT%\.venv\Scripts\activate.bat
|
||||
goto :eof
|
||||
REM venv sicherstellen
|
||||
IF NOT EXIST "%PROJECT%\.venv" (
|
||||
"%PYTHON_EXE%" -m venv "%PROJECT%\.venv"
|
||||
)
|
||||
|
||||
:deactivate_interpreter_local
|
||||
deactivate
|
||||
goto :eof
|
||||
REM venv aktivieren
|
||||
CALL "%PROJECT%\.venv\Scripts\activate.bat"
|
||||
|
||||
:activate_interpreter_network
|
||||
SET OLD_PATH=%PATH%
|
||||
SET PATH=%NETWORK_INTERPRETER_PATH%;%PATH%
|
||||
CALL %PROJECT%\.venv\Scripts\activate.bat
|
||||
goto :eof
|
||||
REM Interpreter festnageln
|
||||
SET VIRTUAL_ENV_PYTHON=%PYTHON_EXE%
|
||||
GOTO :eof
|
||||
|
||||
:deactivate_interpreter_network
|
||||
SET PATH=%OLD_PATH%
|
||||
SET OLD_PATH=
|
||||
SET NETWORK_INTERPRETER_PATH=
|
||||
CALL %PROJECT%\.venv\Scripts\deactivate.bat
|
||||
goto :eof
|
||||
|
||||
:deactivate
|
||||
CALL "%PROJECT%\.venv\Scripts\deactivate.bat"
|
||||
SET VIRTUAL_ENV_PYTHON=
|
||||
GOTO :eofecho off
|
||||
|
||||
+3
-1
@@ -1,4 +1,6 @@
|
||||
@echo off
|
||||
CALL manage_interpreter.bat activate_interpreter
|
||||
python %PROJECT_LIB%\plant2dxf.py %*
|
||||
cd /d %PROJECT%
|
||||
"%VIRTUAL_ENV%\Scripts\python.exe" -m lib.plant2dxf %*
|
||||
CALL manage_interpreter.bat deactivate_interpreter
|
||||
exit /b %ERRORLEVEL%
|
||||
|
||||
@@ -12,8 +12,8 @@ if %ERRORLEVEL% NEQ 0 (
|
||||
pause
|
||||
exit /B 1
|
||||
)
|
||||
|
||||
python -m unittest discover -t %PROJECT_LIB% -s lib\Elemente -p "*_tests.py" -v
|
||||
echo python -m unittest discover -t %PROJECT_LIB% -s %PROJECT_LIB%\Elemente -p "*_tests.py" -v
|
||||
"%VIRTUAL_ENV%\Scripts\python.exe" -m unittest discover -t %PROJECT_LIB% -s %PROJECT_LIB%\Elemente -p "*_tests.py" -v
|
||||
if %ERRORLEVEL% NEQ 0 (
|
||||
echo.
|
||||
echo Tests failed!
|
||||
|
||||
@@ -19,6 +19,7 @@ if not exist %PROJECT%\log mkdir %PROJECT%\log
|
||||
if not exist %PROJECT%\testdata mkdir %PROJECT%\testdata
|
||||
|
||||
set PATH=%PROJECT_BIN%;%PATH%
|
||||
REM set NETWORK_PYTHON=TO_BE_SET
|
||||
|
||||
|
||||
popd
|
||||
|
||||
Reference in New Issue
Block a user