summaryrefslogtreecommitdiffstats
path: root/tox.ini
blob: 9ab1ba6136593342a362119d392676a908402074 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Tox (http://tox.testrun.org/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.

[tox]
envlist = py38-{cov,lint,mypy}, docs, format, format_check

[_test]
deps = .[test]

[_lint]
deps = .[lint]
files = beets beetsplug beet test setup.py docs

[_mypy]
deps =
    .[mypy]
    .[test]

[testenv]
deps =
    {test,cov}: {[_test]deps}
    lint: {[_lint]deps}
    mypy: {[_mypy]deps}
passenv = INTEGRATION_TEST
commands =
    test: python -m pytest {posargs}
    lint: python -m flake8 {posargs} {[_lint]files}
    mypy: mypy

[testenv:docs]
basepython = python3.10
deps =
    sphinx>=5
    pydata_sphinx_theme
commands = sphinx-build -W -q -b html docs {envtmpdir}/html {posargs}

# checks all links in the docs
[testenv:links]
deps = sphinx
allowlist_externals = /bin/bash
commands = /bin/bash -c '! sphinx-build -b linkcheck docs {envtmpdir}/linkcheck | grep "broken\s"'

[testenv:int]
deps = {[_test]deps}
setenv = INTEGRATION_TEST = 1
passenv = GITHUB_ACTIONS
commands = python -bb -m pytest {posargs}

[testenv:format]
deps =
    isort==5.13.2
    black==24.2.0
skip_install = True
commands =
    isort beets beetsplug test
    black beets beetsplug test

[testenv:format_check]
deps =
    isort==5.13.2
    black==24.2.0
skip_install = True
commands =
    isort beets beetsplug test --check --diff
    black beets beetsplug test --check --diff