-
Notifications
You must be signed in to change notification settings - Fork 5
/
pyproject.toml
157 lines (132 loc) · 4.08 KB
/
pyproject.toml
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
157
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "nuts"
version = "3.4.0"
description = "Network Unit Testing System"
authors = [
"Lukas Murer, Méline Sieber, Urs Baumann, Matthias Gabriel, Florian Bruhin",
"Marco Martinez",
"Severin Grimm",
]
maintainers = [
"Marco Martinez <[email protected]>",
"Urs Baumann <[email protected]>",
]
classifiers = ["Framework :: Pytest", "Topic :: System :: Networking"]
homepage = "https://github.com/network-unit-testing-system/nuts"
repository = "https://github.com/network-unit-testing-system/nuts"
license = "MIT"
readme = "README.md"
[tool.poetry.dependencies]
python = "^3.8.1"
pytest = "^7"
PyYAML = "^6.0"
nornir = "^3.3.0"
nornir-napalm = "^0.5.0"
nornir-netmiko = "^1.0.0"
nornir-utils = "^0.2.0"
[tool.poetry.dev-dependencies]
tox = "^4.4.11"
pytest-cov = "^4.0.0"
black = "^24.2.0"
sphinx = "^7"
mypy = "^1.0.1"
flake8 = "^7.0.0"
types-PyYAML = "*"
types-setuptools = "*"
types-toml = "*"
[tool.poetry.plugins."pytest11"]
"nuts" = "nuts.plugin"
# why "pytest11": https://github.com/pytest-dev/pytest/commit/ed03eef81b220199a819632a27f9c452b8e1fb81
# https://docs.pytest.org/en/latest/how-to/writing_plugins.html#making-your-plugin-installable-by-others
[tool.black]
line-length = 88
[tool.pytest.ini_options]
testpaths = "tests"
filterwarnings = [
"error",
"ignore:Using or importing the ABCs from 'collections':DeprecationWarning:napalm\\.base\\.helpers",
"ignore:Using or importing the ABCs from 'collections':DeprecationWarning:jnpr\\.junos\\.factcache",
"ignore:NutsYamlFile\\.fspath is deprecated and will be replaced by NutsYamlFile\\.path\\.",
]
markers = ["nuts_test_ctx: A NutsContext to be used in tests."]
norecursedirs = "mock_project"
[tool.mypy]
python_version = "3.8"
### --strict
warn_unused_configs = true
disallow_any_generics = true
disallow_subclassing_any = true
# disallow_untyped_calls = true
# disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
# no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
# warn_return_any = true
# no_implicit_reexport = true
# strict_equality = true
### Other strictness flags
warn_unreachable = true
disallow_any_unimported = true
### Output
show_error_codes = true
show_error_context = true
pretty = true
[[tool.mypy.overrides]]
module = "ruamel.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "nornir_napalm.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "nornir_netmiko.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "napalm.*"
ignore_missing_imports = true
[tool.tox]
legacy_tox_ini = """
[tox]
isolated_build = True
envlist = py,black,mypy,flake8,docs
testpaths = "tests"
[testenv]
description = Run pytest and generate report
deps =
pytest >= 7.3.0
pytest-cov >= 4.0.0
commands = pytest {posargs} --junitxml=test-reports/pytest.xml --cov="{envsitepackagesdir}/nuts" --cov=tests --cov-report xml:test-reports/coverage.xml
# envsitepackagesdir see: https://tox.readthedocs.io/en/latest/example/pytest.html
[testenv:black]
description = Check formatting with black
skip_install = true
deps = black >= 23.3.0
commands = black --check {posargs} .
[testenv:mypy]
description = Check typing with mypy
deps = mypy >= 1.0.1
types-PyYAML >= 6.0.12.9
passenv = TERM
commands = mypy {posargs} nuts tests
[testenv:docs]
description = Build docs with sphinx
deps = sphinx >= 6.1.3
changedir = docs/
commands = sphinx-build {posargs} source build
[testenv:flake8]
description = Enforce style with Flake8
deps = flake8 >= 6.0.0
commands = flake8 --max-line-length 88 nuts/ tests/
[testenv:pytest-main]
description = Run project tests against pytest-main branch
deps =
git+https://github.com/pytest-dev/pytest.git#main
pytest-cov >= 4.0.0
commands = pytest {posargs} --junitxml=test-reports/pytest.xml --cov="{envsitepackagesdir}/nuts" --cov=tests --cov-report xml:test-reports/coverage.xml
# envsitepackagesdir see: https://tox.readthedocs.io/en/latest/example/pytest.html
"""