Commit f51b0d50 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm-restore: add requirements_dev.txt support

parent 2cde1d57
......@@ -46,7 +46,12 @@ fill_sign()
__epm_restore_pip()
{
local req_file="$1"
[ -n "$dryrun" ] || info "Install requirements from $req_file ..."
if [ -n "$dryrun" ] ; then
echo
echo "# generated by epm --restore --dry-run from $(basename $(dirname $(realpath $req_file)))/$req_file"
else
info "Install requirements from $req_file ..."
fi
local ilist=''
while read l ; do
......@@ -72,6 +77,8 @@ __epm_restore_pip()
continue
fi
if [ -n "$dryrun" ] ; then
local reqmacro="%py3_use"
[ "$(basename "$req_file")" = "requirements_dev.txt" ] && reqmacro="%py3_buildrequires"
local pi=''
local sign ll
for sign in "<=" "<" ">=" ">" "==" "!="; do
......@@ -81,9 +88,9 @@ __epm_restore_pip()
[ "$sign" = "!=" ] && sign=">="
[ -n "$pi" ] && pi="$pi
"
pi="$pi%py3_use $t $sign $ll"
pi="$pi$reqmacro $t $sign $ll"
done
[ -n "$pi" ] || pi="%py3_use $t"
[ -n "$pi" ] || pi="$reqmacro $t"
echo "$pi"
continue
else
......@@ -122,7 +129,7 @@ __epm_restore_by()
fi
case $(basename $req_file) in
requirements.txt|requires.txt)
requirements.txt|requirements_dev.txt|requires.txt)
[ -s "$req_file" ] && __epm_restore_pip "$req_file"
;;
Gemfile|package.json)
......@@ -151,7 +158,7 @@ epm_restore()
# TODO: nowhere works: python3 setup.py --requires
# if run with empty args
for i in requirements.txt Gemfile requires.txt; do
for i in requirements.txt requirements_dev.txt Gemfile requires.txt; do
__epm_restore_by $i
done
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment