Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 13 additions & 15 deletions configure.bat
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,10 @@ set "CFG_BIN_DIR=%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\Scripts"

@rem ################################
@rem # Thirdparty package locations and index handling
if exist ""%CFG_ROOT_DIR%\thirdparty"" (
set "PIP_EXTRA_ARGS=--find-links %CFG_ROOT_DIR%\thirdparty "
if exist "%CFG_ROOT_DIR%\thirdparty" (
set PIP_EXTRA_ARGS=--find-links "%CFG_ROOT_DIR%\thirdparty"
)

set "PIP_EXTRA_ARGS=%PIP_EXTRA_ARGS% --find-links https://thirdparty.aboutcode.org/pypi" & %INDEX_ARG%
@rem ################################


@rem ################################
Expand Down Expand Up @@ -94,8 +92,8 @@ set "PIP_EXTRA_ARGS=%PIP_EXTRA_ARGS% %NO_INDEX%"
@rem # Otherwise the latest Python by default.
if not defined PYTHON_EXECUTABLE (
@rem # check for a file named PYTHON_EXECUTABLE
if exist ""%CFG_ROOT_DIR%\PYTHON_EXECUTABLE"" (
set /p PYTHON_EXECUTABLE=<""%CFG_ROOT_DIR%\PYTHON_EXECUTABLE""
if exist "%CFG_ROOT_DIR%\PYTHON_EXECUTABLE" (
set /p PYTHON_EXECUTABLE=<"%CFG_ROOT_DIR%\PYTHON_EXECUTABLE"
) else (
set "PYTHON_EXECUTABLE=py"
)
Expand All @@ -107,22 +105,22 @@ if not defined PYTHON_EXECUTABLE (
@rem # presence is not consistent across Linux distro and sometimes pip is not
@rem # included either by default. The virtualenv.pyz app cures all these issues.

if not exist ""%CFG_BIN_DIR%\python.exe"" (
if not exist "%CFG_BIN_DIR%\python.exe" (
if not exist "%CFG_BIN_DIR%" (
mkdir %CFG_BIN_DIR%
mkdir "%CFG_BIN_DIR%"
)

if exist ""%CFG_ROOT_DIR%\etc\thirdparty\virtualenv.pyz"" (
if exist "%CFG_ROOT_DIR%\etc\thirdparty\virtualenv.pyz" (
%PYTHON_EXECUTABLE% "%CFG_ROOT_DIR%\etc\thirdparty\virtualenv.pyz" ^
--wheel embed --pip embed --setuptools embed ^
--seeder pip ^
--never-download ^
--no-periodic-update ^
--no-vcs-ignore ^
%CFG_QUIET% ^
%CFG_ROOT_DIR%\%VIRTUALENV_DIR%
"%CFG_ROOT_DIR%\%VIRTUALENV_DIR%"
) else (
if not exist ""%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\virtualenv.pyz"" (
if not exist "%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\virtualenv.pyz" (
curl -o "%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\virtualenv.pyz" %VIRTUALENV_PYZ_URL%

if %ERRORLEVEL% neq 0 (
Expand All @@ -136,7 +134,7 @@ if not exist ""%CFG_BIN_DIR%\python.exe"" (
--no-periodic-update ^
--no-vcs-ignore ^
%CFG_QUIET% ^
%CFG_ROOT_DIR%\%VIRTUALENV_DIR%
"%CFG_ROOT_DIR%\%VIRTUALENV_DIR%"
)
)

Expand All @@ -152,7 +150,7 @@ if %ERRORLEVEL% neq 0 (
@rem # speeds up the installation.
@rem # We always have the PEP517 build dependencies installed already.

%CFG_BIN_DIR%\pip install ^
"%CFG_BIN_DIR%\pip" install ^
--upgrade ^
--no-build-isolation ^
%CFG_QUIET% ^
Expand All @@ -163,7 +161,7 @@ if %ERRORLEVEL% neq 0 (
if exist "%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\bin" (
rmdir /s /q "%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\bin"
)
mklink /J %CFG_ROOT_DIR%\%VIRTUALENV_DIR%\bin %CFG_ROOT_DIR%\%VIRTUALENV_DIR%\Scripts
mklink /J "%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\bin" "%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\Scripts"

if %ERRORLEVEL% neq 0 (
exit /b %ERRORLEVEL%
Expand Down Expand Up @@ -204,4 +202,4 @@ for %%F in (%CLEANABLE%) do (
rmdir /s /q "%CFG_ROOT_DIR%\%%F" >nul 2>&1
del /f /q "%CFG_ROOT_DIR%\%%F" >nul 2>&1
)
exit /b 0
exit /b 0