tox.ini 1.5 KB

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