install-minimal.sh 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/usr/bin/env bash
  2. # Python version can be specified as 3.7, 3.8, 3.9, etc..
  3. if [ -z "$1" ]; then
  4. PYTHON_VERSION=${PYTHON-3.7}
  5. else
  6. if [ "$1" = "3.6" ]; then
  7. PYTHON_VERSION=${PYTHON-3.6}
  8. elif [ "$1" = "3.7" ]; then
  9. PYTHON_VERSION=${PYTHON-3.7}
  10. elif [ "$1" = "3.8" ]; then
  11. PYTHON_VERSION=${PYTHON-3.8}
  12. elif [ "$1" = "3.9" ]; then
  13. PYTHON_VERSION=${PYTHON-3.9}
  14. else
  15. echo "Unsupported Python version."
  16. exit 1
  17. fi
  18. fi
  19. echo "Python version is ${PYTHON_VERSION}"
  20. ROOT_DIR=$(cd "$(dirname "$0")/$(dirname "$(test -L "$0" && readlink "$0" || echo "/")")" || exit; pwd)
  21. WORKSPACE_DIR="${ROOT_DIR}/../.."
  22. # Installs conda and python 3.7
  23. MINIMAL_INSTALL=1 PYTHON=${PYTHON_VERSION} "${WORKSPACE_DIR}/ci/env/install-dependencies.sh"
  24. # Re-install Ray wheels
  25. rm -rf "${WORKSPACE_DIR}/python/ray/thirdparty_files"
  26. rm -rf "${WORKSPACE_DIR}/python/ray/pickle5_files"
  27. eval "${WORKSPACE_DIR}/ci/ci.sh build"
  28. # Install test requirements
  29. python -m pip install -U \
  30. pytest==7.0.1 \
  31. numpy
  32. # Train requirements.
  33. # TODO: make this dynamic
  34. if [ "${TRAIN_MINIMAL_INSTALL-}" = 1 ]; then
  35. python -m pip install -U "ray[tune]"
  36. fi