Skip to content

Commit 1bcaaa5

Browse files
committed
Enforce use of requirements.txt #34
Signed-off-by: Jono Yang <[email protected]>
1 parent fa13562 commit 1bcaaa5

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

Diff for: configure

+8-4
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ CLI_ARGS=$1
2626
################################
2727

2828
# Requirement arguments passed to pip and used by default or with --dev.
29-
REQUIREMENTS="--editable ."
30-
DEV_REQUIREMENTS="--editable .[testing]"
29+
REQUIREMENTS="--editable . --constraint requirements.txt"
30+
DEV_REQUIREMENTS="--editable .[testing] --constraint requirements.txt --constraint requirements-dev.txt"
3131

3232
# where we create a virtualenv
3333
VIRTUALENV_DIR=tmp
@@ -50,8 +50,12 @@ VIRTUALENV_PYZ_URL=https://bootstrap.pypa.io/virtualenv.pyz
5050
CFG_ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
5151
CFG_BIN_DIR=$CFG_ROOT_DIR/$VIRTUALENV_DIR/bin
5252

53-
# Find packages from the local thirdparty directory or from pypi
54-
PIP_EXTRA_ARGS="--find-links $CFG_ROOT_DIR/thirdparty"
53+
# Find packages from the local thirdparty directory or from thirdparty.aboutcode.org
54+
PIP_EXTRA_ARGS="--find-links $CFG_ROOT_DIR/thirdparty --find-links https://thirdparty.aboutcode.org/pypi"
55+
56+
if [[ -f "$CFG_ROOT_DIR/requirements.txt" ]] && [[ -f "$CFG_ROOT_DIR/requirements-dev.txt" ]]; then
57+
PIP_EXTRA_ARGS+=" --no-index"
58+
fi
5559

5660
################################
5761
# Set the quiet flag to empty if not defined

Diff for: configure.bat

+8-3
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
@rem ################################
2525

2626
@rem # Requirement arguments passed to pip and used by default or with --dev.
27-
set "REQUIREMENTS=--editable ."
28-
set "DEV_REQUIREMENTS=--editable .[testing]"
27+
set "REQUIREMENTS=--editable . --constraint requirements.txt"
28+
set "DEV_REQUIREMENTS=--editable .[testing] --constraint requirements.txt --constraint requirements-dev.txt"
2929

3030
@rem # where we create a virtualenv
3131
set "VIRTUALENV_DIR=tmp"
@@ -49,7 +49,12 @@ set "CFG_BIN_DIR=%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\Scripts"
4949

5050
@rem ################################
5151
@rem # Thirdparty package locations and index handling
52-
set "PIP_EXTRA_ARGS=--find-links %CFG_ROOT_DIR%\thirdparty"
52+
if exist ""%CFG_ROOT_DIR%\requirements.txt"" if exist ""%CFG_ROOT_DIR%\requirements-dev.txt"" (
53+
set "INDEX_ARG= --no-index"
54+
) else (
55+
set "INDEX_ARG= "
56+
)
57+
set "PIP_EXTRA_ARGS=--find-links %CFG_ROOT_DIR%\thirdparty --find-links https://thirdparty.aboutcode.org/pypi" & %INDEX_ARG%
5358
@rem ################################
5459

5560

0 commit comments

Comments
 (0)