forked from dj-stripe/dj-stripe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
109 lines (95 loc) · 2.83 KB
/
tox.ini
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
[tox]
envlist =
py36-django{22,30}-{postgres,postgres_native_json,mysql,sqlite}
py37-django{22,30,master}-{postgres,postgres_native_json,mysql,sqlite}
py38-django{22,30,master}-{postgres,postgres_native_json,mysql,sqlite}
py37-django22-checkmigrations
lint
[testenv]
passenv = DJSTRIPE_*
setenv =
postgres: DJSTRIPE_TEST_DB_VENDOR=postgres
postgres_native_json: DJSTRIPE_TEST_DB_VENDOR=postgres
postgres_native_json: USE_NATIVE_JSONFIELD=1
mysql: DJSTRIPE_TEST_DB_VENDOR=mysql
mysql: DJSTRIPE_TEST_DB_HOST=127.0.0.1
mysql: DJSTRIPE_TEST_DB_USER=root
sqlite: DJSTRIPE_TEST_DB_VENDOR=sqlite
PYTHONWARNINGS = all
PYTEST_ADDOPTS = --cov --cov-fail-under=97 --cov-report=html --cov-report=term
commands = pytest {posargs}
deps =
postgres: psycopg2
postgres_native_json: psycopg2
mysql: mysqlclient
django22: Django>=2.2,<2.3
django30: Django>=3.0,<3.1
djangomaster: https://github.com/django/django/archive/master.tar.gz
djangorestframework
pytest-django
pytest-cov
[testenv:lint]
skip_install = True
deps =
flake8
isort
black
commands =
flake8 {toxinidir} {posargs}
isort --check-only
black {toxinidir} --check
[testenv:checkmigrations]
setenv = DJSTRIPE_TEST_DB_VENDOR=sqlite
commands = ./manage.py makemigrations --check --dry-run
[testenv:makemigrations]
setenv = DJSTRIPE_TEST_DB_VENDOR=sqlite
commands = ./manage.py makemigrations
[testenv:makemessages]
whitelist_externals = mkdir
changedir = {toxinidir}/djstripe
commands =
- mkdir -p {toxinidir}/djstripe/locale
- django-admin.py makemessages {posargs}
deps =
Django>=2.2,<2.3
[testenv:docs]
changedir = docs
whitelist_externals = make
commands = make html
deps =
sphinx
sphinx_rtd_theme
sphinx-autobuild
sphinxcontrib-django
[pytest]
DJANGO_SETTINGS_MODULE = tests.settings
# TODO, check that there's fix in restframework for these once they've dropped Django 1.11 support
filterwarnings =
ignore:force_text\(\) is deprecated in favor of force_str\(\):PendingDeprecationWarning:rest_framework.exceptions:39
ignore:smart_text\(\) is deprecated in favor of smart_str\(\):PendingDeprecationWarning:rest_framework.fields:1052
[coverage:run]
branch = True
source = djstripe
omit =
djstripe/migrations/*
djstripe/management/*
djstripe/admin.py
djstripe/checks.py
[coverage:html]
directory = cover
[flake8]
max-complexity = 10
exclude = djstripe/migrations/, .tox/, build/lib/
ignore = W191, W503, E203
max-line-length = 88
[isort]
default_section = THIRDPARTY
known_first_party = djstripe
skip = .tox/
# black compatibility, as per
# https://black.readthedocs.io/en/stable/the_black_code_style.html?highlight=.isort.cfg#how-black-wraps-lines
multi_line_output = 3
include_trailing_comma = True
force_grid_wrap = 0
use_parentheses = True
line_length = 88