Fail on "==" being used for package requirements (but can be suppressed)
This commit is contained in:
parent
b6a9efb0e0
commit
dc209c09a8
1 changed files with 10 additions and 1 deletions
|
@ -150,11 +150,20 @@ check_convert_script() {
|
||||||
info "$py: imports OK"
|
info "$py: imports OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check that all sub-requirements are added to top-level requirements.txt
|
readonly ignore_eq_eq='check_requirements: ignore "=="'
|
||||||
|
|
||||||
for req in "$reqs_dir"/*; do
|
for req in "$reqs_dir"/*; do
|
||||||
|
# Check that all sub-requirements are added to top-level requirements.txt
|
||||||
if ! grep -qFe "$req" ./requirements.txt; then
|
if ! grep -qFe "$req" ./requirements.txt; then
|
||||||
fatal "$req needs to be added to ./requirements.txt"
|
fatal "$req needs to be added to ./requirements.txt"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Make sure exact release versions aren't being pinned in the requirements
|
||||||
|
# Filters out the ignore string
|
||||||
|
req_no_ignore_eq_eq="$(grep -vF "$ignore_eq_eq" "$req")"
|
||||||
|
if grep -Fe '==' <<< "$req_no_ignore_eq_eq" ; then
|
||||||
|
fatal "Avoid pinning exact package versions. Use '=~' instead.\nYou can suppress this error by appending the following to the line: \n\t# $ignore_eq_eq"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
all_venv="$workdir/all-venv"
|
all_venv="$workdir/all-venv"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue