tox.ini 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. flake8
  12. docs
  13. isort
  14. # Add environment to use the default python3 installation
  15. [testenv:py3]
  16. basepython = python3
  17. [testenv]
  18. usedevelop = true
  19. # OBJC_DISABLE_INITIALIZE_FORK_SAFETY fixes hung tests for MacOS users. (#30806)
  20. passenv = DJANGO_SETTINGS_MODULE,PYTHONPATH,HOME,DISPLAY,OBJC_DISABLE_INITIALIZE_FORK_SAFETY
  21. setenv =
  22. PYTHONDONTWRITEBYTECODE=1
  23. deps =
  24. py{3,310,311}: -rtests/requirements/py3.txt
  25. postgres: -rtests/requirements/postgres.txt
  26. mysql: -rtests/requirements/mysql.txt
  27. oracle: -rtests/requirements/oracle.txt
  28. changedir = tests
  29. commands =
  30. {envpython} runtests.py {posargs}
  31. [testenv:black]
  32. basepython = python3
  33. usedevelop = false
  34. deps = black
  35. changedir = {toxinidir}
  36. commands = black --check --diff .
  37. [testenv:flake8]
  38. basepython = python3
  39. usedevelop = false
  40. deps = flake8 >= 3.7.0
  41. changedir = {toxinidir}
  42. commands = flake8 .
  43. [testenv:docs]
  44. basepython = python3
  45. usedevelop = false
  46. allowlist_externals =
  47. make
  48. deps =
  49. Sphinx
  50. pyenchant
  51. sphinxcontrib-spelling
  52. changedir = docs
  53. commands =
  54. make spelling
  55. [testenv:isort]
  56. basepython = python3
  57. usedevelop = false
  58. deps = isort >= 5.1.0
  59. changedir = {toxinidir}
  60. commands = isort --check-only --diff django tests scripts
  61. [testenv:javascript]
  62. usedevelop = false
  63. deps =
  64. changedir = {toxinidir}
  65. allowlist_externals =
  66. npm
  67. commands =
  68. npm install
  69. npm test