tox.ini 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. # Tox (https://tox.readthedocs.io/) is a tool for running tests in multiple
  2. # virtualenvs. This configuration file helps to run the test suite on all
  3. # supported Python versions. To use it, "python -m pip install tox" and
  4. # then run "tox" from this directory.
  5. [tox]
  6. minversion = 3.18
  7. skipsdist = true
  8. envlist =
  9. py3
  10. black
  11. blacken-docs
  12. flake8
  13. docs
  14. isort
  15. # Add environment to use the default python3 installation
  16. [testenv:py3]
  17. basepython = python3
  18. [testenv]
  19. usedevelop = true
  20. # OBJC_DISABLE_INITIALIZE_FORK_SAFETY fixes hung tests for MacOS users. (#30806)
  21. passenv = DJANGO_SETTINGS_MODULE,PYTHONPATH,HOME,DISPLAY,OBJC_DISABLE_INITIALIZE_FORK_SAFETY
  22. setenv =
  23. PYTHONDONTWRITEBYTECODE=1
  24. deps =
  25. py{3,310,311}: -rtests/requirements/py3.txt
  26. postgres: -rtests/requirements/postgres.txt
  27. mysql: -rtests/requirements/mysql.txt
  28. oracle: -rtests/requirements/oracle.txt
  29. changedir = tests
  30. commands =
  31. {envpython} runtests.py {posargs}
  32. [testenv:black]
  33. basepython = python3
  34. usedevelop = false
  35. deps = black
  36. changedir = {toxinidir}
  37. commands = black --check --diff .
  38. [testenv:blacken-docs]
  39. basepython = python3
  40. usedevelop = false
  41. allowlist_externals =
  42. make
  43. deps = blacken-docs
  44. changedir = docs
  45. commands =
  46. make black
  47. [testenv:flake8]
  48. basepython = python3
  49. usedevelop = false
  50. deps = flake8 >= 3.7.0
  51. changedir = {toxinidir}
  52. commands = flake8 .
  53. [testenv:docs]
  54. basepython = python3
  55. usedevelop = false
  56. allowlist_externals =
  57. make
  58. deps =
  59. Sphinx
  60. pyenchant
  61. sphinxcontrib-spelling
  62. changedir = docs
  63. commands =
  64. make spelling
  65. [testenv:isort]
  66. basepython = python3
  67. usedevelop = false
  68. deps = isort >= 5.1.0
  69. changedir = {toxinidir}
  70. commands = isort --check-only --diff django tests scripts
  71. [testenv:javascript]
  72. usedevelop = false
  73. deps =
  74. changedir = {toxinidir}
  75. allowlist_externals =
  76. npm
  77. commands =
  78. npm install
  79. npm test