diff --git a/.gitignore b/.gitignore --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,6 @@ packages/* snippets/ !packages/README -!packages/keys/ \ No newline at end of file +!packages/keys/ + +.venv diff --git a/bin/pip-install-deps b/bin/pip-install-deps deleted file mode 100755 --- a/bin/pip-install-deps +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -LS_DEPS="bin/pip-ls-deps" -if ! [ -x "$LS_DEPS" ] ; then - echo "pip-install-deps should be run from the root of swh-environment. Bye." - exit 2 -fi - -if [ "$1" = '-h' -o "$1" = '--help' ] ; then - echo "Usage: bin/pip-install-deps [PIP3_INSTALL_OPTION]..." - echo - echo "Tip: you can use bin/pip-ls-deps to list the dependencies that will be installed." - exit 2 -fi - -set -x - -requirements=$(mktemp tmp.swh-requirements.txt.XXXXXXXXXX) -trap "rm -f ${requirements}" EXIT -"$LS_DEPS" > "$requirements" - -pip3 install --requirement "$requirements" "$@" diff --git a/bin/pip-ls-deps b/bin/pip-ls-deps deleted file mode 100755 --- a/bin/pip-ls-deps +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -LS_MODS="bin/ls-py-modules" -if ! [ -x "$LS_MODS" ] ; then - echo "pip-ls-deps should be run from the root of swh-environment. Bye." - exit 2 -fi - -for pymod in $(${LS_MODS}) ; do - reqs="${pymod}/requirements.txt" - if [ -f "$reqs" ] ; then - cat "$reqs" - fi -done \ -| egrep -v '^#|^[[:blank:]]*$' \ -| tr '[:upper:]_' '[:lower:]-' \ -| sort -ru \ -| awk '!seen[$1]++' \ -| tac - -# WARNING: CRUDE HACK in the pipeline above. 'pip3 install' will fail if the -# same package name appears multiple times, e.g., as both "django" and "django -# >= 1.10.7" rather than trying to determine (when possible) a comprehensive -# constraint. So we deduplicate here, by first sorting alphabetically which -# will (generally...) put higher dependency constraints last and then -# deduplicate using the sole package name as key. In the example above this -# should only keep "django >= 1.10.7" and get rid of "django". diff --git a/bin/pip-swh-packages b/bin/pip-swh-packages new file mode 100755 --- /dev/null +++ b/bin/pip-swh-packages @@ -0,0 +1,11 @@ +#!/bin/bash + +./bin/py-depgraph | + grep -- '->' | + sed -e 's/[";]//g' -e 's/->//g' | + tsort | + tac | + grep '^swh\.' | + grep -v '\[' | + sed 's:\.:-:g' | + sed 's:^:-e :'