Commit 3d762786 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm-restore: add support for various names of requirements.txt file

parent a2cc30b2
...@@ -30,6 +30,7 @@ __epm_filter_pip_to_rpm() ...@@ -30,6 +30,7 @@ __epm_filter_pip_to_rpm()
-e "s|pillow|Pillow|" \ -e "s|pillow|Pillow|" \
-e "s|redis|redis-py|" \ -e "s|redis|redis-py|" \
-e "s|pyjwt|jwt|" \ -e "s|pyjwt|jwt|" \
-e "s|pytest_cov|pytest-cov|" \
-e "s|pymonetdb|monetdb|" \ -e "s|pymonetdb|monetdb|" \
-e "s|pyyaml|yaml|" \ -e "s|pyyaml|yaml|" \
-e "s|twisted|twisted-core|" \ -e "s|twisted|twisted-core|" \
...@@ -126,7 +127,7 @@ __epm_restore_pip() ...@@ -126,7 +127,7 @@ __epm_restore_pip()
if [ -n "$dryrun" ] ; then if [ -n "$dryrun" ] ; then
reqmacro="%py3_use" reqmacro="%py3_use"
[ "$(basename "$req_file")" = "requirements_dev.txt" ] && reqmacro="%py3_buildrequires" basename "$req_file" | egrep -q "(dev|test)" && reqmacro="%py3_buildrequires"
echo echo
echo "# generated by epm --restore --dry-run from $(basename $(dirname $(realpath $req_file)))/$req_file" echo "# generated by epm --restore --dry-run from $(basename $(dirname $(realpath $req_file)))/$req_file"
cat $req_file | __epm_restore_convert_to_rpm_notation | sed -e "s|^|$reqmacro |" cat $req_file | __epm_restore_convert_to_rpm_notation | sed -e "s|^|$reqmacro |"
...@@ -295,7 +296,7 @@ __epm_restore_by() ...@@ -295,7 +296,7 @@ __epm_restore_by()
fi fi
case $(basename $req_file) in case $(basename $req_file) in
requirements.txt|requirements_dev.txt|requires.txt) requirements.txt|dev-requirements.txt|requirements-dev.txt|requirements_dev.txt|requirements_test.txt|requirements-test.txt|test-requirements.txt|requires.txt)
[ -s "$req_file" ] && __epm_restore_pip "$req_file" [ -s "$req_file" ] && __epm_restore_pip "$req_file"
;; ;;
setup.py|python_dependencies.py) setup.py|python_dependencies.py)
...@@ -330,7 +331,7 @@ epm_restore() ...@@ -330,7 +331,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 requirements_dev.txt Gemfile requires.txt package.json setup.py python_dependencies.py; do for i in requirements.txt requirements_dev.txt requirements-dev.txt dev-requirements.txt requirements-test.txt requirements_test.txt test-requirements.txt Gemfile requires.txt package.json setup.py python_dependencies.py; 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