Debian Codegraph @

pyproject.toml

raw symbols SCIP
1 # content of pyproject.toml
2 [build-system]
3 requires = ["setuptools>=77.0.0"]
4 build-backend = "setuptools.build_meta"
5
6 [project]
7 name = "anta"
8 version = "v1.9.0"
9 readme = "docs/README.md"
10 authors = [{ name = "Arista Networks ANTA maintainers", email = "[email protected]" }]
11 maintainers = [
12 { name = "Arista Networks ANTA maintainers", email = "[email protected]" },
13 { name = "Khelil Sator", email = "[email protected]" },
14 { name = "Matthieu Tâche", email = "[email protected]" },
15 { name = "Thomas Grimonet", email = "[email protected]" },
16 { name = "Guillaume Mulocher", email = "[email protected]" },
17 { name = "Carl Baillargeon", email = "[email protected]" },
18 ]
19 description = "Arista Network Test Automation (ANTA) Framework"
20 dependencies = [
21 "asyncssh>=2.16",
22 "cvprac>=1.3.1",
23 "httpx>=0.27.0",
24 "Jinja2>=3.1.2",
25 "pydantic>=2.7",
26 "pydantic-extra-types>=2.3.0",
27 "pydantic-settings>=2.6.0",
28 "PyYAML>=6.0",
29 "requests>=2.31.0",
30 "rich>=13.5.2,<16",
31 "typing_extensions>=4.12" # required for deprecated before Python 3.13
32 ]
33 keywords = ["test", "anta", "Arista", "network", "automation", "networking", "devops", "netdevops"]
34 license = "Apache-2.0"
35 license-files = ["LICENSE"]
36 classifiers = [
37 "Operating System :: OS Independent",
38 "Development Status :: 5 - Production/Stable",
39 "Intended Audience :: Developers",
40 "Intended Audience :: System Administrators",
41 "Intended Audience :: Information Technology",
42 "Programming Language :: Python",
43 "Programming Language :: Python :: 3",
44 "Programming Language :: Python :: 3.10",
45 "Programming Language :: Python :: 3.11",
46 "Programming Language :: Python :: 3.12",
47 "Programming Language :: Python :: 3.13",
48 "Programming Language :: Python :: 3.14",
49 "Programming Language :: Python :: 3 :: Only",
50 "Topic :: Software Development :: Libraries :: Python Modules",
51 "Topic :: Software Development :: Testing",
52 "Topic :: System :: Networking",
53 ]
54 requires-python = ">=3.10"
55
56 [project.optional-dependencies]
57 cli = [
58 "click~=8.3",
59 ]
60
61 [dependency-groups]
62
63 dev = [
64 {include-group = "test"},
65 {include-group = "lint"},
66 "bumpver>=2026.1132",
67 ]
68 test = [
69 "pytest-asyncio>=1.4.0",
70 "pytest-cov>=7.1.0",
71 "pytest-codspeed>=5.0.3",
72 "pytest-html>=4.2.0",
73 "pytest-httpx>=0.36.2",
74 "pytest-metadata>=3.1.1",
75 "pytest>=9.1.1",
76 "respx>=0.23.1",
77 "tox>=4.56.4,<5.0.0",
78 ]
79 lint = [
80 "codespell>=2.4.2,<2.5.0",
81 "pre-commit>=4.6.0",
82 "pylint-pydantic>=0.4.1",
83 "pylint>=4.0.6",
84 "pyright",
85 "ruff>=0.15.20,<0.16.0",
86 "types-PyYAML",
87 "types-pyOpenSSL",
88 "types-requests",
89 "typing-extensions",
90 "yamllint>=1.38.0",
91 ]
92
93 doc = [
94 "griffe >=2.1.0,<2.2",
95 "griffe-warnings-deprecated~=1.1.1",
96 "mike @ git+https://github.com/squidfunk/mike.git@2d4ad799442f4592db8ad53b179bfb33db8c69ac",
97 "zensical==0.0.47",
98 "mkdocs~=1.6",
99 "mkdocs-autorefs~=1.4",
100 "mkdocs-material~=9.7",
101 "mkdocs-material-extensions>=1.3.1",
102 "mkdocstrings[python]~=1.0.4",
103 "mkdocstrings-python~=2.0.5",
104 ]
105 [project.urls]
106 Homepage = "https://anta.arista.com"
107 "Bug Tracker" = "https://github.com/aristanetworks/anta/issues"
108 Contributing = "https://anta.arista.com/main/contribution/"
109
110 [project.scripts]
111 anta = "anta.cli:cli"
112
113 [tool.setuptools.packages.find]
114 include = ["anta*", "asynceapi*"]
115 namespaces = false
116
117 [tool.setuptools.package-data]
118 "anta" = ["py.typed"]
119
120 ################################
121 # Version
122 ################################
123 [tool.bumpver]
124 current_version = "1.9.0"
125 version_pattern = "MAJOR.MINOR.PATCH[.PYTAGNUM]"
126 commit_message = "bump: Version {old_version} -> {new_version}"
127 commit = true
128 # No tag
129 tag = false
130 push = false
131
132 [tool.bumpver.file_patterns]
133 "pyproject.toml" = ['current_version = "{version}"', 'version = "v{version}"']
134 "docs/contribution.md" = ["anta {version}"]
135 "docs/requirements-and-installation.md " = ["anta, version v{version}"]
136
137 ################################
138 # Typing
139 ################################
140 [tool.pyright]
141 typeCheckingMode = "standard"
142 exclude = [
143 # Excluded
144 ".tox",
145 ]
146 pythonVersion = "3.10"
147 reportMissingImports = "error"
148
149 ################################
150 # Testing
151 ################################
152 [tool.pytest.ini_options]
153 # When run from anta directory this will read cov-config from pyproject.toml
154 addopts = "-ra -q -vv --cov --cov-report term:skip-covered --color yes"
155 log_level = "WARNING"
156 render_collapsed = true
157 testpaths = ["tests"]
158 asyncio_mode = "auto"
159 asyncio_default_fixture_loop_scope = "function"
160 norecursedirs = ["tests/benchmark", ".*"] # Do not run performance testing outside of Codspeed
161 filterwarnings = [
162 # cvprac is raising the next warning
163 "default:pkg_resources is deprecated:DeprecationWarning",
164 # Need to investigate the following - only occurring when running the full pytest suite
165 "ignore:Exception ignored in.*:pytest.PytestUnraisableExceptionWarning",
166 # Ignore cryptography >=43.0.0 warnings until asyncssh issue is fixed
167 "ignore:ARC4:cryptography.utils.CryptographyDeprecationWarning",
168 "ignore:TripleDES:cryptography.utils.CryptographyDeprecationWarning",
169
170 ]
171
172
173 [tool.coverage.run]
174 branch = true
175 # https://community.sonarsource.com/t/python-coverage-analysis-warning/62629/7
176 include = ["anta/*", "asynceapi/*"]
177 parallel = true
178 relative_files = true
179
180 [tool.coverage.report]
181 # Regexes for lines to exclude from consideration
182 exclude_lines = [
183 # Have to re-enable the standard pragma
184 "pragma: no cover",
185
186 # Don't complain about missing debug-only code:
187 "def __repr__",
188 "if self\\.debug",
189
190 # Don't complain if tests don't hit defensive assertion code:
191 "raise AssertionError",
192 "raise NotImplementedError",
193
194 # Don't complain if non-runnable code isn't run:
195 "if 0:",
196 "if __name__ == .__main__.:",
197
198 # Don't complain about abstract methods, they aren't run:
199 "@(abc\\.)?abstractmethod",
200
201 # Don't complain about TYPE_CHECKING blocks
202 "if TYPE_CHECKING:",
203
204 # Don't complain about sys.version block
205 # Assume the tests of various Python version is handling this
206 "if sys.version_info >= (.*):",
207
208 # Don't complain about expected ImportError
209 "except ImportError:",
210 ]
211
212 ignore_errors = true
213
214 [tool.coverage.html]
215 directory = "coverage_html_report"
216
217 [tool.coverage.xml]
218 output = "coverage.xml"
219
220 ################################
221 # Ruff
222 ################################
223 [tool.ruff]
224
225 # Exclude a variety of commonly ignored directories.
226 exclude = [
227 ".bzr",
228 ".direnv",
229 ".eggs",
230 ".git",
231 ".git-rewrite",
232 ".hg",
233 ".ipynb_checkpoints",
234 ".mypy_cache",
235 ".nox",
236 ".pants.d",
237 ".pyenv",
238 ".pytest_cache",
239 ".pytype",
240 ".ruff_cache",
241 ".svn",
242 ".tox",
243 ".venv",
244 ".vscode",
245 "__pypackages__",
246 "_build",
247 "buck-out",
248 "build",
249 "dist",
250 "node_modules",
251 "site-packages",
252 "venv",
253 ".github",
254 ]
255
256 line-length = 165
257
258 # Assume Python 3.10 as this is the lowest supported version for ANTA
259 target-version = "py310"
260
261 [tool.ruff.lint]
262 # select all cause we like being suffering
263 select = ["ALL",
264 # By enabling a convention for docstrings, ruff automatically ignore some rules that need to be
265 # added back if we want them.
266 # https://docs.astral.sh/ruff/faq/#does-ruff-support-numpy-or-google-style-docstrings
267 "D212",
268 "D415",
269 "D417",
270 ]
271 ignore = [
272 "COM812", # Ignoring conflicting rules that may cause conflicts when used with the formatter
273 "ISC001", # Ignoring conflicting rules that may cause conflicts when used with the formatter
274 "TD002", # We don't have require authors in TODO
275 "TD003", # We don't have an issue link for all TODOs today
276 "FIX002", # Line contains TODO - ignoring for ruff for now
277 "F821", # Disable undefined-name until resolution of #10451
278 ]
279
280 # Allow autofix for all enabled rules (when `--fix`) is provided.
281 fixable = ["ALL"]
282 unfixable = []
283
284 # Allow unused variables when underscore-prefixed.
285 dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
286
287 [tool.ruff.lint.pydocstyle]
288 convention = "numpy"
289
290 [tool.ruff.lint.pylint]
291 # These settings are used to configure pylint rules run in ruff. In order to keep sane and while
292 # we have not removed pylint completely, these settings should be kept in sync with our pylintrc file.
293 # https://github.com/astral-sh/ruff/issues/970
294 max-branches = 13
295 max-args = 10
296
297 [tool.ruff.lint.mccabe]
298 # Unlike Flake8, default to a complexity level of 10.
299 max-complexity = 10
300
301 [tool.ruff.lint.pep8-naming]
302 "ignore-names" = [
303 "RICH_COLOR_PALETTE"
304 ]
305
306
307 [tool.ruff.lint.flake8-type-checking]
308 # These classes require that type annotations be available at runtime
309 runtime-evaluated-base-classes = ["pydantic.BaseModel", "anta.models.AntaTest.Input"]
310
311
312 [tool.ruff.lint.per-file-ignores]
313 "tests/*" = [
314 "S101", # Complains about asserts in units and libs.
315 "SLF001", # Lots of private member accessed for test purposes
316 ]
317 "tests/units/*" = [
318 "ARG002", # Sometimes we need to declare unused arguments when a parameter is not used but declared in @pytest.mark.parametrize
319 "FBT001", # Boolean-typed positional argument in function definition
320 "PLR2004", # Magic value used in comparison, consider replacing {value} with a constant variable
321 "S105", # Passwords are indeed hardcoded in tests
322 "S106", # Passwords are indeed hardcoded in tests
323 "S108", # Probable insecure usage of temporary file or directory
324 "PLC0415", # We do import modules in random places where needed for testing purposes
325 ]
326 "tests/units/anta_tests/test_interfaces.py" = [
327 "S104", # False positive for 0.0.0.0 bindings in test inputs
328 ]
329 "tests/units/anta_tests/*" = [
330 "F401", # In this module, we import tests.units.anta_tests.test without using it to auto-generate tests
331 ]
332 "anta/*" = [
333 "TRY400", # Use `logging.exception` instead of `logging.error` - we know what we are doing
334 ]
335 "anta/cli/exec/utils.py" = [
336 "SLF001", # TODO: some private members, lets try to fix
337 ]
338 "anta/cli/__init__.py" = [
339 "T201", # Allow print statements
340 ]
341 "anta/cli/*" = [
342 "PLR0913", # CLI has many arguments defined in functions
343 ]
344 "anta/tests/field_notices.py" = [
345 "PLR2004", # Magic value used in comparison, consider replacing 2131 with a constant variable - Field notice IDs are magic values
346 "C901", # TODO: test function is too complex, needs a refactor
347 "PLR0911", # TODO: Too many return statements, same as above needs a refactor
348 ]
349 "anta/tests/routing/isis.py" = [
350 "C901", # TODO: test function is too complex, needs a refactor
351 "PLR0912" # Too many branches (15/12) (too-many-branches), needs a refactor
352 ]
353 "anta/tests/logging.py" = [
354 "A005", # TODO: Module `logging` shadows a Python standard-library module
355 ]
356 "anta/input_models/logging.py" = [
357 "A005", # TODO: Module `logging` shadows a Python standard-library module
358 ]
359 "anta/decorators.py" = [
360 "ANN401", # Ok to use Any type hint in our decorators
361 ]
362 "anta/tools.py" = [
363 "ANN401", # Ok to use Any type hint in our custom get functions
364 ]
365 "examples/*.py" = [ # These are example scripts and linked in snippets
366 "S105", # Possible hardcoded password
367 "S106", # Possible hardcoded password assigned to argument
368 "S108", # Probable insecure usage of temporary file or directory
369 "INP001", # Implicit packages
370 "T201", # `print` found
371 "T203", # `pprint` found
372
373 ]
374
375 ################################
376 # Pylint
377 ################################
378 [tool.pylint]
379 disable = [ # Any rule listed here can be disabled: https://github.com/astral-sh/ruff/issues/970
380 "invalid-name",
381 "fixme",
382 "unused-import",
383 "unused-argument",
384 "keyword-arg-before-vararg",
385 "protected-access",
386 "too-many-arguments",
387 "too-many-positional-arguments",
388 "wrong-import-position",
389 "pointless-statement",
390 "broad-exception-caught",
391 "line-too-long",
392 "unused-variable",
393 "redefined-builtin",
394 "global-statement",
395 "reimported",
396 "wrong-import-order",
397 "wrong-import-position",
398 "unnecessary-lambda",
399 "abstract-class-instantiated", # Overlap with https://mypy.readthedocs.io/en/stable/error_code_list.html#check-instantiation-of-abstract-classes-abstract
400 "unexpected-keyword-arg", # Overlap with https://mypy.readthedocs.io/en/stable/error_code_list.html#check-arguments-in-calls-call-arg and other rules
401 "no-value-for-parameter", # Overlap with https://mypy.readthedocs.io/en/stable/error_code_list.html#check-arguments-in-calls-call-arg
402 "import-outside-toplevel"
403 ]
404 max-statements=61
405 max-returns=8
406 max-locals=23
407 max-line-length=165
408 max-module-lines=1700
409 # making similarity lines limit a bit higher than default 4
410 min-similarity-lines=10
411 # https://stackoverflow.com/questions/49680191/click-and-pylint
412 signature-mutators="click.decorators.option"
413 load-plugins="pylint_pydantic"
414 extension-pkg-whitelist="pydantic"
415 # Pylint does not treat dataclasses differently: https://github.com/pylint-dev/pylint/issues/9058
416 max-attributes=15