install-minimal.sh 1.2 KB

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