Skip to content
Snippets Groups Projects
Forked from Platform / Development / swh-deposit
42 commits behind the upstream repository.
tox.ini 1.75 KiB
[tox]
minversion = 4
envlist =
  black
  flake8
  mypy
  py3-django2
  py3-django3

[testenv]
extras =
  testing
deps =
  # the dependency below is needed for now as a workaround for
  #   https://github.com/pypa/pip/issues/6239
  swh.core[http] >= 0.3
  swh.scheduler[testing] >= 0.5.0
  dev: pdbpp
  pytest-cov
  django2: Django>=2,<3
  django3: Django>=3,<4
commands =
  pytest --doctest-modules \
         --rootdir {envsitepackagesdir} \
         --cov={envsitepackagesdir}/swh/deposit \
         --cov-branch \
         --ignore {envsitepackagesdir}/swh/deposit/settings/ \
         {envsitepackagesdir}/swh/deposit \
         {posargs}
# --rootdir (with --import-mode from pytest.ini) are required to make tests
# that depends on the test file to be a proper submodule of the swh namespace
# after migration to PEP420 (implicit namespace).

[testenv:black]
skip_install = true
deps =
  black==23.1.0
commands =
  {envpython} -m black --check swh

[testenv:flake8]
skip_install = true
deps =
  flake8==5.0.4
  flake8-bugbear==22.9.23
  pycodestyle==2.9.1
commands =
  {envpython} -m flake8 \
    --exclude=.tox,.git,__pycache__,.tox,.eggs,*.egg,swh/deposit/migrations

[testenv:mypy]
setenv = DJANGO_SETTINGS_MODULE=swh.deposit.settings.testing
extras =
  testing
deps =
  mypy==1.0.1
commands =
  mypy swh

# build documentation outside swh-environment using the current
# git HEAD of swh-docs, is executed on CI for each diff to prevent
# breaking doc build
[testenv:sphinx]
allowlist_externals = make
extras =
  testing
deps =
  # fetch and install swh-docs
  git+https://gitlab.softwareheritage.org/swh/devel/swh-docs.git\#egg=swh.docs
setenv =