summaryrefslogtreecommitdiff
path: root/tox.ini
blob: 8b241dc8062855228c7698479a5002cc87b0cbfb (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
[tox]
envlist = py

[testenv]
cov_args=--cov=dogpile --cov-append --cov-report term --cov-report xml


setenv=
    BASECOMMAND=python -m pytest

    {generic}:  RUNTESTS=-k 'not test_dbm_backend and not test_memcached_backend and not test_redis_backend'

    {memcached}: PIFPAF=pifpaf --env-prefix DOGPILE run memcached --port {env:TOX_DOGPILE_PORT:11234} --
    {memcached}: PIFPAF_TLS=pifpaf --env-prefix DOGPILE_TLS run memcached --port {env:TOX_DOGPILE_TLS_PORT:11212} --ssl_chain_cert=tests/tls/server_chain.pem --ssl_key=tests/tls/server.key --
    {memcached}: RUNTESTS=tests/cache/test_memcached_backend.py

    {redis}: PIFPAF=pifpaf --env-prefix DOGPILE run redis --port {env:TOX_DOGPILE_PORT:11234} --
    {redis}: RUNTESTS=tests/cache/test_redis_backend.py

    {redis_sentinel}: PIFPAF=pifpaf --env-prefix DOGPILE run redis --port {env:TOX_DOGPILE_PORT:11234} --sentinel --sentinel-port {env:TOX_DOGPILE_SENTINEL_PORT:11235} --
    {redis_sentinel}: RUNTESTS=tests/cache/test_redis_sentinel_backend.py

    {dbm}: RUNTESTS=tests/cache/test_dbm_backend.py

    {cov}: COVERAGE={[testenv]cov_args}

    {full}: FULL=-m ''

deps=
    pytest>=5.4.0
    Mako
    decorator>=4.0.0
    # Needed for an async runner test.
    {memcached}: pylibmc

    # the py3k python-memcached fails for multiple
    # delete
    {memcached}: python-memcached
    {memcached}: python-binary-memcached>=0.29.0
    {memcached}: pifpaf>=2.5.0
    {memcached}: pymemcache>=3.5.0
    {redis}: redis
    {redis}: pifpaf
    {redis_sentinel}: redis
    {redis_sentinel}: pifpaf
    {cov}: pytest-cov

commands=
  {env:PIFPAF:} {env:PIFPAF_TLS:} {env:BASECOMMAND} {env:COVERAGE:} {env:FULL:} {env:RUNTESTS:} {posargs}

sitepackages=False
usedevelop=True


[testenv:pep484]
basepython = python3
deps=
    mypy
    types-decorator
    types-redis
    redis
    Mako
    decorator
    types-redis
    types-decorator
commands = mypy ./dogpile/

[testenv:mypy]
basepython = python3
deps=
    {[testenv:pep484]deps}
commands = mypy ./dogpile/


# thanks to https://julien.danjou.info/the-best-flake8-extensions/
[testenv:pep8]
basepython = python3
deps=
      flake8
      flake8-import-order
      flake8-builtins
      flake8-docstrings
      flake8-rst-docstrings
      # used by flake8-rst-docstrings
      pygments
      black==22.3.0
commands =
    flake8 ./dogpile/ ./tests/ setup.py  {posargs}
    black --check .