tox.ini 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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 = 4.0
  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. -e .
  26. py{3,310,311,312,313,py3}: -rtests/requirements/py3.txt
  27. postgres: -rtests/requirements/postgres.txt
  28. mysql: -rtests/requirements/mysql.txt
  29. oracle: -rtests/requirements/oracle.txt
  30. changedir = tests
  31. commands =
  32. {envpython} runtests.py {posargs}
  33. [testenv:black]
  34. basepython = python3
  35. usedevelop = false
  36. deps = black
  37. changedir = {toxinidir}
  38. commands = black --check --diff .
  39. [testenv:blacken-docs]
  40. basepython = python3
  41. usedevelop = false
  42. allowlist_externals =
  43. make
  44. deps = blacken-docs
  45. changedir = docs
  46. commands =
  47. make black
  48. [testenv:flake8]
  49. basepython = python3
  50. usedevelop = false
  51. deps = flake8 >= 3.7.0
  52. changedir = {toxinidir}
  53. commands = flake8 .
  54. [testenv:docs]
  55. basepython = python3
  56. usedevelop = false
  57. allowlist_externals =
  58. make
  59. deps =
  60. Sphinx
  61. pyenchant
  62. sphinxcontrib-spelling
  63. changedir = docs
  64. commands =
  65. make spelling
  66. [testenv:isort]
  67. basepython = python3
  68. usedevelop = false
  69. deps = isort >= 5.1.0
  70. changedir = {toxinidir}
  71. commands = isort --check-only --diff django tests scripts
  72. [testenv:javascript]
  73. usedevelop = false
  74. deps =
  75. changedir = {toxinidir}
  76. allowlist_externals =
  77. npm
  78. commands =
  79. npm install
  80. npm test