[tox]
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/docbow/{env:BRANCH_NAME:}
envlist = py3-{django22,django32}-{pw,pfwb}-coverage,py3-{django22,django32}-mellon-coverage,py3-{django22,django32}-pfwbmellon-coverage, black

[testenv]
usedevelop = True
deps =
  setuptools<50
  M2Crypto
  django22: django>=2.2,<2.3
  django32: django>=3.2.12,<3.3
  pfwb: SQLAlchemy-Utils<0.36.7
  django-webtest
  mock<4
  psycopg2<2.9
  pytest
  pytest-cov
  pytest-django
  pytz
  mellon: django-mellon
  pfwbmellon: django-mellon
  py3: beautifulsoup4
  pre-commit
setenv =
  SECRET_KEY=changeme
  pw: PARLEMENT=pw
  pfwb: PARLEMENT=pfwb
  DJANGO_SETTINGS_MODULE=docbow_project.settings
  DOCBOW_SETTINGS_FILE=tests/settings.py
  mellon: DOCBOW_SETTINGS_FILE=tests/sso/settings.py
  pfwbmellon: DOCBOW_SETTINGS_FILE=tests/pfwbmellon/settings.py
  coverage: COVERAGE=--cov-append --cov-report xml --cov-report html --cov=docbow_project/ --cov-config .coveragerc
  BRANCH_NAME={env:BRANCH_NAME:}
commands =
  ./getlasso3.sh
  pw: py.test {posargs: {env:COVERAGE:} --junitxml=junit-{envname}.xml tests/main/ tests/pw/}
  pfwb: py.test {posargs: {env:COVERAGE:} --junitxml=junit-{envname}.xml tests/main/ tests/pfwb/}
  mellon: py.test {posargs: {env:COVERAGE:} --junitxml=junit-{envname}.xml tests/sso/}
  pfwbmellon: py.test {posargs: {env:COVERAGE:} --junitxml=junit-{envname}.xml tests/pfwbmellon/}
  black: pre-commit run black --all-files --show-diff-on-failure
