keras-update 882 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/bash
  2. set -e
  3. root=$(cd $(dirname ${0})/..; pwd)
  4. build=${root}/build
  5. tools=${root}/tools
  6. third_party=${root}/third_party
  7. python=${python:-python}
  8. pip=${pip:-pip}
  9. identifier=keras
  10. repository=https://github.com/keras-team/${identifier}.git
  11. mkdir -p ${third_party}
  12. if [ -d "${third_party}/${identifier}" ]; then
  13. git -C "${third_party}/${identifier}" fetch -p
  14. git -C "${third_party}/${identifier}" reset --hard origin/master
  15. else
  16. echo "Clone ${repository}..."
  17. git -C "${third_party}" clone --recursive ${repository}
  18. fi
  19. echo "Install Keras"
  20. export PYTHONUSERBASE=${build}/third_party/pypi/${identifier}
  21. export PATH=${PATH}:${build}/third_party/pypi/${identifier}/bin
  22. rm -rf ${PYTHONUSERBASE}
  23. ${pip} install --user ${third_party}/${identifier}
  24. echo "Update '../src/keras-metadata.json'"
  25. pushd ${tools} > /dev/null
  26. ${python} keras-metadata.py
  27. popd > /dev/null