.travis.yml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. brew install python3 ||
  24. brew upgrade python3
  25. fi
  26. - |
  27. if [ "${TRAVIS_OS_NAME}" == linux -a -n "${WINE_PYTHON}" ]; then
  28. pushd "$(mktemp -d)" &&
  29. sudo dpkg --add-architecture i386 &&
  30. wget https://dl.winehq.org/wine-builds/Release.key -O Release.key &&
  31. sudo apt-key add Release.key &&
  32. sudo apt-add-repository https://dl.winehq.org/wine-builds/ubuntu/ &&
  33. sudo apt-get update &&
  34. sudo apt-get install -y --no-install-recommends unzip winehq-stable &&
  35. curl "https://www.python.org/ftp/python/${WINE_PYTHON}/python-${WINE_PYTHON}-embed-win32.zip" -o python.zip &&
  36. curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py &&
  37. unzip python.zip -d python &&
  38. pushd python &&
  39. LIB="$(echo python*.zip)" &&
  40. mv "${LIB}" "${LIB}.tmp" &&
  41. unzip "${LIB}.tmp" -d "${LIB}" &&
  42. rm "${LIB}.tmp" &&
  43. popd &&
  44. mv python "$(winepath 'C:\python')" &&
  45. printf %b 'Windows Registry Editor Version 5.00\n'\
  46. '[HKEY_CURRENT_USER\\Environment]\n'\
  47. '"Path"="c:\\\\windows;c:\\\\windows\\\\system;c:\\\\python;c:\\\\python\\\\scripts"\n' > path.reg &&
  48. wine regedit path.reg &&
  49. wine python get-pip.py &&
  50. rm -rf "$(dirs -l +0)" &&
  51. popd
  52. fi
  53. install:
  54. - pip3 install --upgrade coverage coveralls
  55. - ${PIP} install --upgrade --editable .[test,md5,bcrypt]
  56. script:
  57. - ${PYTHON} setup.py test
  58. after_success:
  59. - |
  60. if [ "${TRAVIS_OS_NAME}" == linux -a -n "${WINE_PYTHON}" ]; then
  61. config="$(mktemp)"
  62. printf '[paths]\nsource =\n .\n %s\n' "$(winepath --windows '')" >"${config}"
  63. coverage3 combine --rcfile "${config}" .coverage
  64. fi
  65. - env COVERALLS_PARALLEL=true coveralls