File: tox.ini

package info (click to toggle)
python-gitlab 1%3A8.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,884 kB
  • sloc: python: 25,823; makefile: 171; ruby: 27; javascript: 3
file content (156 lines) | stat: -rw-r--r-- 3,961 bytes parent folder | download
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
[tox]
minversion = 4.0
skipsdist = True
skip_missing_interpreters = True
envlist = py314,py313,py312,py311,py310,black,isort,flake8,mypy,twine-check,cz,pylint

# NOTE(jlvillal): To use a label use the `-m` flag.
# For example to run the `func` label group of environments do:
#   tox -m func
labels =
    lint = black,isort,flake8,mypy,pylint,cz
    unit = py314,py313,py312,py311,py310
# func is the functional tests. This is very time consuming.
    func = cli_func_v4,api_func_v4

[testenv]
passenv =
  DOCKER_HOST
  FORCE_COLOR
  GITHUB_ACTIONS
  GITHUB_WORKSPACE
  GITLAB_IMAGE
  GITLAB_TAG
  GITLAB_RUNNER_IMAGE
  GITLAB_RUNNER_TAG
  NO_COLOR
  PWD
  PY_COLORS
setenv = 
  DOCS_SOURCE = docs
  DOCS_BUILD = build/sphinx/html
  VIRTUAL_ENV={envdir}
whitelist_externals = true
usedevelop = True
install_command = pip install {opts} {packages} -e .
isolated_build = True

deps = -r{toxinidir}/requirements.txt
       -r{toxinidir}/requirements-test.txt
commands =
  pytest tests/unit {posargs}

[testenv:black]
basepython = python3
deps = -r{toxinidir}/requirements-lint.txt
commands =
  black {posargs} .

[testenv:isort]
basepython = python3
deps = -r{toxinidir}/requirements-lint.txt
commands =
  isort {posargs} {toxinidir}

[testenv:mypy]
basepython = python3
deps = -r{toxinidir}/requirements-lint.txt
commands =
  mypy {posargs}

[testenv:flake8]
basepython = python3
deps = -r{toxinidir}/requirements-lint.txt
commands =
  flake8 {posargs} .

[testenv:pylint]
basepython = python3
deps = -r{toxinidir}/requirements-lint.txt
commands =
  pylint {posargs} gitlab/

[testenv:cz]
basepython = python3
deps = -r{toxinidir}/requirements-lint.txt
commands =
  cz check --rev-range 65ecadc..HEAD  # cz is fast, check from first valid commit

[testenv:twine-check]
basepython = python3
deps = -r{toxinidir}/requirements.txt
       build
       twine
commands =
  python -m build
  twine check dist/*

[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
# E701: multiple statements on one line (colon)
# E704: multiple statements on one line (def)
# W503: Line break occurred before a binary operator
extend-ignore = E203,E501,E701,E704,W503
per-file-ignores =
    gitlab/v4/objects/__init__.py:F401,F403

[testenv:docs]
description = Builds the docs site. Generated HTML files will be available in '{env:DOCS_BUILD}'. 
deps = -r{toxinidir}/requirements-docs.txt
commands = sphinx-build -n -W --keep-going -b html {env:DOCS_SOURCE} {env:DOCS_BUILD}

[testenv:docs-serve]
description = 
    Builds and serves the HTML docs site locally. \
    Use this for verifying updates to docs. \
    Changes to docs files will be automatically rebuilt and served.
deps = -r{toxinidir}/requirements-docs.txt
commands = sphinx-autobuild {env:DOCS_SOURCE} {env:DOCS_BUILD} --open-browser --port 8000

[testenv:cover]
commands =
  pytest --cov --cov-report term --cov-report html \
    --cov-report xml tests/unit {posargs}

[coverage:run]
omit = *tests*
source = gitlab

[coverage:report]
exclude_lines =
  pragma: no cover
  if TYPE_CHECKING:
  if debug:
  return NotImplemented

[testenv:cli_func_v4]
deps = -r{toxinidir}/requirements-docker.txt
commands =
  pytest --script-launch-mode=subprocess --cov --cov-report xml tests/functional/cli {posargs}

[testenv:api_func_v4]
deps = -r{toxinidir}/requirements-docker.txt
commands =
  pytest --cov --cov-report xml tests/functional/api {posargs}

[testenv:smoke]
deps = -r{toxinidir}/requirements-test.txt
commands = pytest tests/smoke {posargs}

[testenv:pre-commit]
skip_install = true
deps = -r requirements-precommit.txt
commands = pre-commit run --all-files --show-diff-on-failure

[testenv:install]
skip_install = true
deps = -r{toxinidir}/requirements.txt
       -r{toxinidir}/requirements-test.txt
commands = pytest tests/install