install.sh 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #!/bin/bash
  2. set -e
  3. set -x
  4. # Travis clones with depth=50 which might be too shallow for git describe, see https://github.com/pypa/setuptools_scm/issues/93
  5. git fetch --unshallow --tags
  6. if [ "${TRAVIS_OS_NAME}" = "osx" ]
  7. then
  8. # Update brew itself
  9. export HOMEBREW_NO_AUTO_UPDATE=1 # Auto-updating everything would take too much time
  10. brew update > /dev/null
  11. brew cleanup # Preempt possible scheduled clean-up so it doesn't clutter the log later
  12. # Install and/or upgrade dependencies
  13. #brew install zstd || brew upgrade zstd # Installation takes very long due to CMake dependency and isn't necessary for the tests as borg comes bundled with zstd anyway
  14. brew install lz4 || brew upgrade lz4
  15. brew install xz || brew upgrade xz # Required for Python lzma module
  16. brew install Caskroom/cask/osxfuse || brew upgrade Caskroom/cask/osxfuse # Required for Python llfuse module
  17. brew install pyenv || brew upgrade pyenv
  18. # Configure pkg-config to use OpenSSL 1.1 from Homebrew
  19. export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig:${PKG_CONFIG_PATH}"
  20. # Configure pyenv with Python version according to TOXENV
  21. eval "$(pyenv init -)"
  22. if [ "${TOXENV}" = "py36" ]
  23. then
  24. pyenv install 3.6.0
  25. pyenv global 3.6.0
  26. elif [ "${TOXENV}" = "py37" ]
  27. then
  28. pyenv install 3.7.0
  29. pyenv global 3.7.0
  30. else
  31. printf '%s\n' "Unexpected value for TOXENV environment variable"
  32. exit 1
  33. fi
  34. pyenv rehash
  35. elif [ "${TRAVIS_OS_NAME}" = "linux" ]
  36. then
  37. # Install dependencies
  38. sudo apt-get update
  39. sudo apt-get install -y pkg-config fakeroot
  40. #sudo apt-get install -y liblz4-dev # Too old on trusty and xenial, but might be useful in future versions
  41. #sudo apt-get install -y libzstd-dev # Too old on trusty and xenial, but might be useful in future versions
  42. sudo apt-get install -y libacl1-dev
  43. sudo apt-get install -y libfuse-dev fuse || true # Required for Python llfuse module
  44. sudo apt-get install -y libfuse3-dev fuse3 || true # Required for Python pyfuse3 module
  45. else
  46. printf '%s\n' "Unexpected value for TRAVIS_OS_NAME environment variable"
  47. exit 1
  48. fi
  49. # Setup and activate virtual environment
  50. python -m pip install virtualenv
  51. python -m virtualenv ~/.venv
  52. source ~/.venv/bin/activate
  53. # Install requirements
  54. pip install -r requirements.d/development.txt
  55. pip install codecov
  56. python setup.py --version