2021-06-30 23:19:18 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2021-06-30 23:32:53 +02:00
|
|
|
set +x
|
2021-06-30 23:19:18 +02:00
|
|
|
which pyreq-merge &> /dev/null
|
|
|
|
if [ $? -gt 0 ]; then
|
|
|
|
>&2 echo pyreq-merge missing, please install requirements
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2021-06-30 23:32:53 +02:00
|
|
|
PIP_INDEX_URL=${PIP_INDEX_URL:-http://localhost/python}
|
2021-06-30 23:19:18 +02:00
|
|
|
in=$(mktemp)
|
|
|
|
out=$(mktemp)
|
|
|
|
>&2 echo using tmp $t
|
|
|
|
cat ../../requirements.txt > $out
|
|
|
|
|
|
|
|
repos=(../../cic-cache ../../cic-eth ../../cic-ussd ../../data-seeding ../../cic-notify)
|
|
|
|
|
|
|
|
|
|
|
|
for r in ${repos[@]}; do
|
|
|
|
f="$r/requirements.txt"
|
|
|
|
>&2 echo updating $f
|
|
|
|
pyreq-merge $f $out -vv > $in
|
|
|
|
cp $in $out
|
|
|
|
|
|
|
|
f="$r/test_requirements.txt"
|
|
|
|
if [ -f $f ]; then
|
|
|
|
>&2 echo updating $f
|
|
|
|
pyreq-merge $f $out -vv > $in
|
|
|
|
cp $in $out
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
cp -v $out compiled_requirements.txt
|
|
|
|
|
|
|
|
outd=$(mktemp -d)
|
|
|
|
for r in ${repos[@]}; do
|
2021-06-30 23:32:53 +02:00
|
|
|
f=$(realpath $r/requirements.txt)
|
2021-06-30 23:19:18 +02:00
|
|
|
b=$(basename $f)
|
2021-06-30 23:32:53 +02:00
|
|
|
b_in=$b.in
|
2021-06-30 23:19:18 +02:00
|
|
|
d=$(basename $r)
|
2021-06-30 23:32:53 +02:00
|
|
|
echo output to $outd/$d/$b_in
|
2021-06-30 23:19:18 +02:00
|
|
|
mkdir -vp $outd/$d
|
2021-06-30 23:32:53 +02:00
|
|
|
echo "-r $f" > $outd/$d/$b_in
|
|
|
|
pyreq-update -v $f compiled_requirements.txt >> $outd/$d/$b_in
|
|
|
|
pip-compile -v --extra-index-url $PIP_INDEX_URL $outd/$d/$b_in -o $outd/$d/$b
|
|
|
|
if [ $? -gt 0 ]; then
|
|
|
|
>&2 echo requirement compile failed for $f
|
|
|
|
exit 1
|
|
|
|
fi
|
2021-06-30 23:19:18 +02:00
|
|
|
done
|
2021-06-30 23:32:53 +02:00
|
|
|
set -x
|