diff --git a/configure b/configure index 99bdf57..66d939a 100755 --- a/configure +++ b/configure @@ -26,8 +26,8 @@ CLI_ARGS=$1 ################################ # Requirement arguments passed to pip and used by default or with --dev. -REQUIREMENTS="--editable ." -DEV_REQUIREMENTS="--editable .[testing]" +REQUIREMENTS="--editable . --constraint requirements.txt" +DEV_REQUIREMENTS="--editable .[testing] --constraint requirements.txt --constraint requirements-dev.txt" # where we create a virtualenv VIRTUALENV_DIR=tmp @@ -50,8 +50,12 @@ VIRTUALENV_PYZ_URL=https://bootstrap.pypa.io/virtualenv.pyz CFG_ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" CFG_BIN_DIR=$CFG_ROOT_DIR/$VIRTUALENV_DIR/bin -# Find packages from the local thirdparty directory or from pypi -PIP_EXTRA_ARGS="--find-links $CFG_ROOT_DIR/thirdparty" +# Find packages from the local thirdparty directory or from thirdparty.aboutcode.org +PIP_EXTRA_ARGS="--find-links $CFG_ROOT_DIR/thirdparty --find-links https://thirdparty.aboutcode.org/pypi" + +if [[ -f "$CFG_ROOT_DIR/requirements.txt" ]] && [[ -f "$CFG_ROOT_DIR/requirements-dev.txt" ]]; then + PIP_EXTRA_ARGS+=" --no-index" +fi ################################ # Set the quiet flag to empty if not defined diff --git a/configure.bat b/configure.bat index be8f579..75cab5f 100644 --- a/configure.bat +++ b/configure.bat @@ -24,8 +24,8 @@ @rem ################################ @rem # Requirement arguments passed to pip and used by default or with --dev. -set "REQUIREMENTS=--editable ." -set "DEV_REQUIREMENTS=--editable .[testing]" +set "REQUIREMENTS=--editable . --constraint requirements.txt" +set "DEV_REQUIREMENTS=--editable .[testing] --constraint requirements.txt --constraint requirements-dev.txt" @rem # where we create a virtualenv set "VIRTUALENV_DIR=tmp" @@ -49,7 +49,12 @@ set "CFG_BIN_DIR=%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\Scripts" @rem ################################ @rem # Thirdparty package locations and index handling -set "PIP_EXTRA_ARGS=--find-links %CFG_ROOT_DIR%\thirdparty" +if exist ""%CFG_ROOT_DIR%\requirements.txt"" if exist ""%CFG_ROOT_DIR%\requirements-dev.txt"" ( + set "INDEX_ARG= --no-index" +) else ( + set "INDEX_ARG= " +) +set "PIP_EXTRA_ARGS=--find-links %CFG_ROOT_DIR%\thirdparty --find-links https://thirdparty.aboutcode.org/pypi" & %INDEX_ARG% @rem ################################