diff --git a/build-telemac.bat b/build-telemac.bat index d28f60b2b7fbd2cf80e6b8d11f623f76d42d49d5..7f14707a3fca19cd4a2332bdda8b638f62724080 100644 --- a/build-telemac.bat +++ b/build-telemac.bat @@ -462,8 +462,15 @@ cd %python% rd /s/q libs del dev.msi -rem Remove the _pth file -del python3*._pth +rem Update the _pth file to include TELEMAC scripts and API folders +for /f "tokens=*" %%g in ('dir python*._pth /b') do (set pth_file=%%g) +for /f "tokens=*" %%g in ('dir python*.zip /b') do (set zip_file=%%g) +echo %zip_file%> %pth_file% +echo .>> %pth_file% +echo Lib\site-packages>> %pth_file% +echo ..\..\scripts\python3>> %pth_file% +echo ..\..\builds\gnu.static\wrap_api\lib>> %pth_file% +echo import site>> %pth_file% rem Copy python.exe to python3.exe to ensure the proper execution of TELEMAC rem scripts having the shebang form #!/usr/bin/env python3 @@ -659,9 +666,6 @@ echo rem Add TELEMAC binaries directory to PATH>> %file_name% echo set PATH=%%HOMETEL%%\builds\%%USETELCFG%%\lib;%%PATH%%>> %file_name% echo rem Add TELEMAC Python scripts folder to PATH>> %file_name% echo set PATH=%%HOMETEL%%\scripts\python3;%%PATH%%>> %file_name% -echo rem Add TELEMAC Python scripts to PYTHONPATH>> %file_name% -echo set PYTHONPATH=%%HOMETEL%%\scripts\python3;%%PYTHONPATH%%>> %file_name% -echo set PYTHONPATH=%%HOMETEL%%\builds\%%USETELCFG%%\wrap_api\lib;%%PYTHONPATH%%>> %file_name% echo:>> %file_name% echo rem Paths to external libraries>> %file_name% echo rem HDF5>> %file_name%