tox.ini 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. [tox]
  2. envlist = packaging, py27, py36, pep8, check_isort
  3. [base]
  4. deps =
  5. coverage
  6. Twisted>=15.1
  7. mock
  8. python-subunit
  9. junitxml
  10. # needed by some of the tests
  11. lxml
  12. setenv =
  13. PYTHONDONTWRITEBYTECODE = no_byte_code
  14. [testenv]
  15. deps =
  16. {[base]deps}
  17. setenv =
  18. {[base]setenv}
  19. passenv = *
  20. commands =
  21. /usr/bin/find "{toxinidir}" -name '*.pyc' -delete
  22. coverage run {env:COVERAGE_OPTS:} --source="{toxinidir}/synapse" \
  23. "{envbindir}/trial" {env:TRIAL_FLAGS:} {posargs:tests} {env:TOXSUFFIX:}
  24. {env:DUMP_COVERAGE_COMMAND:coverage report -m}
  25. [testenv:py27]
  26. # As of twisted 16.4, trial tries to import the tests as a package (previously
  27. # it loaded the files explicitly), which means they need to be on the
  28. # pythonpath. Our sdist doesn't include the 'tests' package, so normally it
  29. # doesn't work within the tox virtualenv.
  30. #
  31. # As a workaround, we tell tox to do install with 'pip -e', which just
  32. # creates a symlink to the project directory instead of unpacking the sdist.
  33. #
  34. # (An alternative to this would be to set PYTHONPATH to include the project
  35. # directory. Note two problems with this:
  36. #
  37. # - if you set it via `setenv`, then it is also set during the 'install'
  38. # phase, which inhibits unpacking the sdist, so the virtualenv isn't
  39. # useful for anything else without setting PYTHONPATH similarly.
  40. #
  41. # - `synapse` is also loaded from PYTHONPATH so even if you only set
  42. # PYTHONPATH for the test phase, we're still running the tests against
  43. # the working copy rather than the contents of the sdist. So frankly
  44. # you might as well use -e in the first place.
  45. #
  46. # )
  47. usedevelop=true
  48. [testenv:py27-postgres]
  49. usedevelop=true
  50. deps =
  51. {[base]deps}
  52. psycopg2
  53. setenv =
  54. {[base]setenv}
  55. SYNAPSE_POSTGRES = 1
  56. [testenv:py35]
  57. usedevelop=true
  58. [testenv:py36]
  59. usedevelop=true
  60. [testenv:packaging]
  61. deps =
  62. check-manifest
  63. commands =
  64. check-manifest
  65. [testenv:pep8]
  66. skip_install = True
  67. basepython = python2.7
  68. deps =
  69. flake8
  70. commands = /bin/sh -c "flake8 synapse tests {env:PEP8SUFFIX:}"
  71. [testenv:check_isort]
  72. skip_install = True
  73. deps = isort
  74. commands = /bin/sh -c "isort -c -sp setup.cfg -rc synapse tests"
  75. [testenv:check-newsfragment]
  76. skip_install = True
  77. deps = towncrier>=18.6.0rc1
  78. commands =
  79. python -m towncrier.check --compare-with=origin/develop
  80. basepython = python3.6