Enforce "compatible release" syntax instead of ==
This commit is contained in:
parent
dc209c09a8
commit
91f318c228
5 changed files with 17 additions and 15 deletions
|
@ -135,18 +135,20 @@ check_convert_script() {
|
||||||
python3 -m venv "$venv"
|
python3 -m venv "$venv"
|
||||||
|
|
||||||
check_requirements "$venv" "$reqs"
|
check_requirements "$venv" "$reqs"
|
||||||
set +e
|
|
||||||
(
|
# Because we mask the return value of the subshell,
|
||||||
|
# we don't need to use set +e/-e.
|
||||||
|
# shellcheck disable=SC2155
|
||||||
|
local py_err=$(
|
||||||
# shellcheck source=/dev/null
|
# shellcheck source=/dev/null
|
||||||
source "$venv/bin/activate"
|
source "$venv/bin/activate"
|
||||||
py_err="$workdir/$pyname.out"
|
python "$py" 2>&1
|
||||||
python "$py" 2> "$py_err"
|
|
||||||
>&2 cat "$py_err"
|
|
||||||
grep -e 'ModuleNotFoundError' "$py_err"
|
|
||||||
)
|
)
|
||||||
set -e
|
|
||||||
# shellcheck disable=SC2181
|
# shellcheck disable=SC2181
|
||||||
(( $? )) && fatal "$py: some imports not declared in $reqs"
|
if grep -Fe 'ModuleNotFoundError' <<< "$py_err"; then
|
||||||
|
fatal "$py: some imports not declared in $reqs"
|
||||||
|
fi
|
||||||
info "$py: imports OK"
|
info "$py: imports OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,7 +164,7 @@ for req in "$reqs_dir"/*; do
|
||||||
# Filters out the ignore string
|
# Filters out the ignore string
|
||||||
req_no_ignore_eq_eq="$(grep -vF "$ignore_eq_eq" "$req")"
|
req_no_ignore_eq_eq="$(grep -vF "$ignore_eq_eq" "$req")"
|
||||||
if grep -Fe '==' <<< "$req_no_ignore_eq_eq" ; then
|
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"
|
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
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
-r ./requirements-convert.txt
|
-r ./requirements-convert.txt
|
||||||
torch==2.1.1
|
torch~=2.1.1
|
||||||
transformers==4.35.2
|
transformers~=4.35.2
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
-r ./requirements-convert.txt
|
-r ./requirements-convert.txt
|
||||||
torch==2.1.1
|
torch~=2.1.1
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
-r ./requirements-convert.txt
|
-r ./requirements-convert.txt
|
||||||
torch==2.1.1
|
torch~=2.1.1
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
numpy==1.24.4
|
numpy~=1.24.4
|
||||||
sentencepiece==0.1.98
|
sentencepiece~=0.1.98
|
||||||
transformers>=4.34.0
|
transformers>=4.34.0
|
||||||
gguf>=0.1.0
|
gguf>=0.1.0
|
||||||
protobuf>=4.21.0
|
protobuf>=4.21.0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue