Skip to content
Merged
Changes from 2 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
30 changes: 15 additions & 15 deletions configure.bat
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ 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%
set "PIP_EXTRA_ARGS=%PIP_EXTRA_ARGS%" --find-links https://thirdparty.aboutcode.org/pypi & %INDEX_ARG%
@rem ################################


Expand All @@ -67,15 +67,15 @@ if not defined CFG_QUIET (
@rem ################################
@rem # Main command line entry point
set CFG_DEV_MODE=0
set "CFG_REQUIREMENTS=%REQUIREMENTS%"
set CFG_REQUIREMENTS=%REQUIREMENTS%
set "NO_INDEX=--no-index"

:again
if not "%1" == "" (
if "%1" EQU "--help" (goto cli_help)
if "%1" EQU "--clean" (goto clean)
if "%1" EQU "--dev" (
set "CFG_REQUIREMENTS=%DEV_REQUIREMENTS%"
set CFG_REQUIREMENTS=%DEV_REQUIREMENTS%
set CFG_DEV_MODE=1
)
if "%1" EQU "--init" (
Expand All @@ -94,8 +94,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 +107,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 +136,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 +152,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 +163,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