install.sh 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 # Required for Python llfuse module
  44. else
  45. printf '%s\n' "Unexpected value for TRAVIS_OS_NAME environment variable"
  46. exit 1
  47. fi
  48. # Setup and activate virtual environment
  49. python -m pip install virtualenv
  50. python -m virtualenv ~/.venv
  51. source ~/.venv/bin/activate
  52. # Install requirements
  53. pip install -r requirements.d/development.txt
  54. pip install codecov
  55. python setup.py --version
  56. # Recent versions of OS X don't allow kernel extensions which makes the osxfuse tests fail; those versions are marked with SKIPFUSE=true in .travis.yml
  57. if [ "${SKIPFUSE}" = "true" ]
  58. then
  59. truncate -s 0 requirements.d/fuse.txt
  60. pip install -e .
  61. else
  62. pip install -e .[fuse]
  63. fi