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
|
[tox]
minversion = 1.6
skipsdist = True
envlist = py39,py38,py37,py36,pep8,black,twine-check,mypy,isort
[testenv]
passenv = GITLAB_IMAGE GITLAB_TAG
setenv = VIRTUAL_ENV={envdir}
whitelist_externals = true
usedevelop = True
install_command = pip install {opts} {packages}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
pytest gitlab/tests {posargs}
[testenv:pep8]
basepython = python3
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
flake8
commands =
flake8 {posargs} .
[testenv:black]
basepython = python3
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
black
commands =
black {posargs} .
[testenv:isort]
basepython = python3
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
isort
commands =
isort --dont-order-by-type {posargs} {toxinidir}
[testenv:twine-check]
basepython = python3
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
twine
commands =
twine check dist/*
[testenv:mypy]
basepython = python3
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
mypy {posargs}
[testenv:venv]
commands = {posargs}
[flake8]
exclude = .git,.venv,.tox,dist,doc,*egg,build,
max-line-length = 88
# We ignore the following because we use black to handle code-formatting
# E203: Whitespace before ':'
# E501: Line too long
# W503: Line break occurred before a binary operator
ignore = E203,E501,W503
per-file-ignores =
gitlab/v4/objects/__init__.py:F401,F403
[isort]
profile = black
multi_line_output = 3
[testenv:docs]
deps = -r{toxinidir}/rtd-requirements.txt
commands = python setup.py build_sphinx
[testenv:cover]
commands =
pytest --cov --cov-report term --cov-report html \
--cov-report xml gitlab/tests {posargs}
[coverage:run]
omit = *tests*
source = gitlab
[coverage:report]
exclude_lines =
pragma: no cover
if TYPE_CHECKING:
if debug:
[pytest]
script_launch_mode = subprocess
[testenv:cli_func_v4]
deps = -r{toxinidir}/docker-requirements.txt
commands =
pytest --cov --cov-report xml tests/functional/cli {posargs}
[testenv:py_func_v4]
deps = -r{toxinidir}/docker-requirements.txt
commands =
pytest --cov --cov-report xml tests/functional/api {posargs}
|