.travis.yml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. language: python
  2. sudo: false
  3. env: PIP=pip3 PYTHON=python3
  4. dist: trusty
  5. matrix:
  6. include:
  7. - os: linux
  8. python: 3.5
  9. - os: linux
  10. python: 3.6
  11. - os: osx
  12. language: generic
  13. - os: linux
  14. python: 3.5
  15. sudo: required
  16. env: WINE_PYTHON=3.5.4 PIP='wine pip' PYTHON='wine python'
  17. notifications:
  18. webhooks:
  19. - https://coveralls.io/webhook?repo_token=COVERALLS_REPO_TOKEN
  20. before_install:
  21. - |
  22. if [ "${TRAVIS_OS_NAME}" == osx ]; then
  23. rm '/usr/local/include/c++'
  24. brew install python3 ||
  25. brew upgrade python3
  26. fi
  27. - |
  28. if [ "${TRAVIS_OS_NAME}" == linux -a -n "${WINE_PYTHON}" ]; then
  29. pushd "$(mktemp -d)" &&
  30. sudo dpkg --add-architecture i386 &&
  31. wget https://dl.winehq.org/wine-builds/winehq.key -O winehq.key &&
  32. sudo apt-key add winehq.key &&
  33. sudo apt-add-repository https://dl.winehq.org/wine-builds/ubuntu/ &&
  34. sudo apt-get update &&
  35. sudo apt-get install -y --no-install-recommends unzip winehq-stable &&
  36. curl "https://www.python.org/ftp/python/${WINE_PYTHON}/python-${WINE_PYTHON}-embed-win32.zip" -o python.zip &&
  37. curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py &&
  38. unzip python.zip -d python &&
  39. pushd python &&
  40. LIB="$(echo python*.zip)" &&
  41. mv "${LIB}" "${LIB}.tmp" &&
  42. unzip "${LIB}.tmp" -d "${LIB}" &&
  43. rm "${LIB}.tmp" &&
  44. popd &&
  45. mv python "$(winepath 'C:\python')" &&
  46. printf %b 'Windows Registry Editor Version 5.00\n'\
  47. '[HKEY_CURRENT_USER\\Environment]\n'\
  48. '"Path"="c:\\\\windows;c:\\\\windows\\\\system;c:\\\\python;c:\\\\python\\\\scripts"\n' > path.reg &&
  49. wine regedit path.reg &&
  50. wine python get-pip.py &&
  51. rm -rf "$(dirs -l +0)" &&
  52. popd
  53. fi
  54. install:
  55. - pip3 install --upgrade coverage coveralls
  56. - ${PIP} install --upgrade --editable .[test,md5,bcrypt]
  57. script:
  58. - ${PYTHON} setup.py test
  59. after_success:
  60. - |
  61. if [ "${TRAVIS_OS_NAME}" == linux -a -n "${WINE_PYTHON}" ]; then
  62. config="$(mktemp)"
  63. printf '[paths]\nsource =\n .\n %s\n' "$(winepath --windows '')" >"${config}"
  64. coverage3 combine --rcfile "${config}" .coverage
  65. fi
  66. - env COVERALLS_PARALLEL=true coveralls