forked from canonical/serialized-data-interface
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
62 lines (57 loc) · 1.87 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
[flake8]
max-line-length = 100
max-doc-length = 100
max-complexity = 11
docstring-convention = google
ignore =
W503, # line break before binary operator
W504, # line break after binary operator
D100, # module-level docstring
D104, # package-level docstring
D105, # magic method docstring
D107, # __init__ docstring
D401, # "imperative mood" in docstrings
N818 # exceptions must have Error suffix
builtins = FileNotFoundError
exclude =
juju/client/_*
.git
__pycache__
.tox
build
dist
*.egg_info
venv
# D100, D101, D102, D103: Ignore missing docstrings in tests
per-file-ignores = *test/*:D100,D101,D102,D103,D104,D415
# Check for properly formatted copyright header in each file
copyright-check = True
copyright-author = Canonical Ltd.
[tox]
skipsdist = True
[testenv:unit]
setenv =
PYTHONBREAKPOINT=ipdb.set_trace
deps =
poetry
commands =
poetry install -v
poetry run pytest -vvs --tb=native {posargs:test/unit/}
[testenv:lint]
setenv =
# https://github.com/python/mypy/issues/11274
PYTHONUSERBASE = /nonexistent
deps =
poetry
commands =
poetry config virtualenvs.create false
poetry install -v
# ops package doesn't publish stubs, but type checking is good enough without them. mypy has
# really weird handling of imports without known, published stubs, so convince mypy that it's
# OK.
poetry run python -c "import site, pathlib; pathlib.Path(site.getsitepackages()[0]).joinpath('ops/py.typed').touch()"
poetry run flake8 {toxinidir}/serialized_data_interface {toxinidir}/test
poetry run black --check {toxinidir}/serialized_data_interface {toxinidir}/test
poetry run isort --check --diff {toxinidir}/serialized_data_interface {toxinidir}/test
poetry run mypy {toxinidir}/serialized_data_interface {toxinidir}/test
poetry run mdformat --check --wrap=100 {toxinidir}/README.md