[gh-actions]
python =
  3.10: py310
  3.11: py311
  3.12: py312
  3.13: py313

[gh-actions:env]
DJANGO =
  4.2: django42
  5.0: django50
  5.1: django51
  5.2: django52
TARGET =
  pil: pil
  imagemagick: imagemagick
  graphicsmagick: graphicsmagick
  redis: redis
  wand: wand
  dbm: dbm
  qa: qa

[tox]
skipsdist = True
envlist =
  py310-qa,
  py{310,311,312}-django{42}-{pil,imagemagick,graphicsmagick,redis,dynamodb,wand,pgmagick,dbm,vipsthumbnail}
  py{310,311,312}-django{50}-{pil,imagemagick,graphicsmagick,redis,dynamodb,wand,pgmagick,dbm,vipsthumbnail}
  py{310,311,312,313}-django{51}-{pil,imagemagick,graphicsmagick,redis,dynamodb,wand,pgmagick,dbm,vipsthumbnail}
  py{310,311,312,313}-django{52}-{pil,imagemagick,graphicsmagick,redis,dynamodb,wand,pgmagick,dbm,vipsthumbnail}

[testenv]
deps =
  coverage[toml]
  pillow
  redis: redis
  dynamodb: boto
  pgmagick: pgmagick
  wand: wand
  django42: django>=4.2,<4.3
  django50: django>=5.0,<5.1
  django51: django>=5.1,<5.2
  django52: django>=5.2,<5.3

setenv =
  PYTHONPATH = {toxinidir}:{toxinidir}
  pil: DJANGO_SETTINGS_MODULE=tests.settings.pil
  imagemagick: DJANGO_SETTINGS_MODULE=tests.settings.imagemagick
  graphicsmagick: DJANGO_SETTINGS_MODULE=tests.settings.graphicsmagick
  vipsthumbnail: DJANGO_SETTINGS_MODULE=tests.settings.vipsthumbnail
  redis: DJANGO_SETTINGS_MODULE=tests.settings.redis
  dynamodb: DJANGO_SETTINGS_MODULE=tests.settings.dynamodb
  wand: DJANGO_SETTINGS_MODULE=tests.settings.wand
  pgmagick: DJANGO_SETTINGS_MODULE=tests.settings.pgmagick
  dbm: DJANGO_SETTINGS_MODULE=tests.settings.dbm
commands =
  coverage run {envbindir}/django-admin test -v2 {posargs:}
  coverage report -m
  coverage xml

[testenv:py310-qa]
skip_install = True
deps =
  ruff
  rstvalidator
commands =
  ruff check sorl/
  python -m rstvalidator README.rst CHANGES.rst CONTRIBUTING.rst
