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() ...@@ -46,7 +46,12 @@ fill_sign()
__epm_restore_pip() __epm_restore_pip()
{ {
local req_file="$1" 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='' local ilist=''
while read l ; do while read l ; do
...@@ -72,6 +77,8 @@ __epm_restore_pip() ...@@ -72,6 +77,8 @@ __epm_restore_pip()
continue continue
fi fi
if [ -n "$dryrun" ] ; then if [ -n "$dryrun" ] ; then
local reqmacro="%py3_use"
[ "$(basename "$req_file")" = "requirements_dev.txt" ] && reqmacro="%py3_buildrequires"
local pi='' local pi=''
local sign ll local sign ll
for sign in "<=" "<" ">=" ">" "==" "!="; do for sign in "<=" "<" ">=" ">" "==" "!="; do
...@@ -81,9 +88,9 @@ __epm_restore_pip() ...@@ -81,9 +88,9 @@ __epm_restore_pip()
[ "$sign" = "!=" ] && sign=">=" [ "$sign" = "!=" ] && sign=">="
[ -n "$pi" ] && pi="$pi [ -n "$pi" ] && pi="$pi
" "
pi="$pi%py3_use $t $sign $ll" pi="$pi$reqmacro $t $sign $ll"
done done
[ -n "$pi" ] || pi="%py3_use $t" [ -n "$pi" ] || pi="$reqmacro $t"
echo "$pi" echo "$pi"
continue continue
else else
...@@ -122,7 +129,7 @@ __epm_restore_by() ...@@ -122,7 +129,7 @@ __epm_restore_by()
fi fi
case $(basename $req_file) in case $(basename $req_file) in
requirements.txt|requires.txt) requirements.txt|requirements_dev.txt|requires.txt)
[ -s "$req_file" ] && __epm_restore_pip "$req_file" [ -s "$req_file" ] && __epm_restore_pip "$req_file"
;; ;;
Gemfile|package.json) Gemfile|package.json)
...@@ -151,7 +158,7 @@ epm_restore() ...@@ -151,7 +158,7 @@ epm_restore()
# TODO: nowhere works: python3 setup.py --requires # TODO: nowhere works: python3 setup.py --requires
# if run with empty args # 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 __epm_restore_by $i
done 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