diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-03-28 06:11:39 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-03-28 06:11:39 +0000 |
commit | 1fd6a618b60d7168fd8f37585d5d39d22d775afd (patch) | |
tree | fbc6d0c213b8acdd0a31deafe5c5fc0d05a3a312 /pyproject.toml | |
parent | Initial commit. (diff) | |
download | anta-1fd6a618b60d7168fd8f37585d5d39d22d775afd.tar.xz anta-1fd6a618b60d7168fd8f37585d5d39d22d775afd.zip |
Adding upstream version 0.13.0.upstream/0.13.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'pyproject.toml')
-rw-r--r-- | pyproject.toml | 340 |
1 files changed, 340 insertions, 0 deletions
diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..9a23db3 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,340 @@ +# content of pyproject.toml +[build-system] +requires = ["setuptools>=64.0.0", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "anta" +version = "v0.13.0" +readme = "docs/README.md" +authors = [{ name = "Khelil Sator", email = "ksator@arista.com" }] +maintainers = [ + { name = "Khelil Sator", email = "ksator@arista.com" }, + { name = "Matthieu Tâche", email = "mtache@arista.com" }, + { name = "Thomas Grimonet", email = "tgrimonet@arista.com" }, + { name = "Guillaume Mulocher", email = "gmulocher@arista.com" }, +] +description = "Arista Network Test Automation (ANTA) Framework" +license = { file = "LICENSE" } +dependencies = [ + "aiocache~=0.12.2", + "aio-eapi==0.6.3", + "click~=8.1.6", + "click-help-colors~=0.9", + "cvprac~=1.3.1", + "pydantic>=2.1.1,<2.7.0", + "pydantic-extra-types>=2.1.0", + "PyYAML~=6.0", + "requests~=2.31.0", + "rich>=13.5.2,<13.8.0", + "rich>=13.5.2,<13.8.0", + "asyncssh>=2.13.2,<2.15.0", + "Jinja2~=3.1.2", +] +keywords = ["test", "anta", "Arista", "network", "automation", "networking", "devops", "netdevops"] +classifiers = [ + "License :: OSI Approved :: Apache Software License", + "Operating System :: OS Independent", + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Intended Audience :: Information Technology", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3 :: Only", + "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: Software Development :: Testing", + "Topic :: System :: Networking", +] +requires-python = ">=3.8" + +[project.optional-dependencies] +dev = [ + "bumpver==2023.1129", + "black==24.2.0", + "flake8==7.0.0", + "isort==5.13.2", + "mypy~=1.7", + "mypy-extensions~=1.0", + "pre-commit>=3.3.3", + "pylint>=2.17.5", + "ruff>=0.0.280", + "pytest>=7.4.0", + "pytest-asyncio>=0.21.1", + "pytest-cov>=4.1.0", + "pytest-dependency", + "pytest-html>=3.2.0", + "pytest-metadata>=3.0.0", + "pylint-pydantic>=0.2.4", + "tox>=4.10.0,<5.0.0", + "types-PyYAML", + "types-paramiko", + "types-requests", + "typing-extensions", + "yamllint>=1.32.0", +] +doc = [ + "mkdocs>=1.3.1", + "mkdocs-autorefs>=0.4.1", + "mkdocs-bootswatch>=1.1", + "mkdocs-git-revision-date-localized-plugin>=1.1.0", + "mkdocs-git-revision-date-plugin>=0.3.2", + "mkdocs-material>=8.3.9", + "mkdocs-material-extensions>=1.0.3", + "mkdocstrings[python]>=0.20.0", + "fontawesome_markdown", + "mike==2.0.0", + "griffe==0.41.1" +] + +[project.urls] +Homepage = "https://www.anta.ninja" +"Bug Tracker" = "https://github.com/arista-netdevops-community/anta/issues" +Contributing = "https://www.anta.ninja/main/contribution/" + +[project.scripts] +anta = "anta.cli:cli" + + +################################ +# Tools +################################ +[tool.setuptools.packages.find] +include = ["anta*"] +namespaces = false + +################################ +# Version +################################ +[tool.bumpver] +current_version = "0.13.0" +version_pattern = "MAJOR.MINOR.PATCH" +commit_message = "bump: Version {old_version} -> {new_version}" +commit = true +# No tag +tag = false +push = false + +[tool.bumpver.file_patterns] +"pyproject.toml" = ['current_version = "{version}"', 'version = "v{version}"'] +"docs/contribution.md" = ["anta {version}"] +"docs/requirements-and-installation.md " = ["anta, version v{version}"] + +################################ +# Linting +################################ +[tool.isort] +profile = "black" +line_length = 165 + +[tool.black] +line-length = 165 +force-exclude = """ +( +.*data.py| +) +""" + +################################ +# Typing +# mypy as per https://pydantic-docs.helpmanual.io/mypy_plugin/#enabling-the-plugin +################################ +[tool.mypy] +plugins = [ + "pydantic.mypy", + ] +# Comment below for better type checking +#follow_imports = "skip" +ignore_missing_imports = true +warn_redundant_casts = true +# Note: tox find some unused type ignore which are required for pre-commit +# To investigate +warn_unused_ignores = true +disallow_any_generics = true +check_untyped_defs = true +no_implicit_reexport = true +strict_optional = true + +# for strict mypy: (this is the tricky one :-)) +disallow_untyped_defs = true + +[tool.pydantic-mypy] +init_forbid_extra = true +init_typed = true +warn_required_dynamic_aliases = true +warn_untyped_fields = true + +################################ +# Testing +################################ +[tool.pytest.ini_options] +# TODO - may need cov-append for Tox +# When run from anta directory this will read cov-config from pyproject.toml +addopts = "-ra -q -s -vv --capture=tee-sys --cov --cov-report term:skip-covered --color yes" +log_level = "WARNING" +log_cli = true +render_collapsed = true +filterwarnings = [ + "ignore::urllib3.exceptions.InsecureRequestWarning" +] +testpaths = ["tests"] + +[tool.coverage.run] +branch = true +source = ["anta"] +parallel = true +omit = [ + # omit aioeapi patch + "anta/aioeapi.py", + ] + +[tool.coverage.report] +# Regexes for lines to exclude from consideration +exclude_lines = [ + # Have to re-enable the standard pragma + "pragma: no cover", + + # Don't complain about missing debug-only code: + "def __repr__", + "if self\\.debug", + + # Don't complain if tests don't hit defensive assertion code: + "raise AssertionError", + "raise NotImplementedError", + + # Don't complain if non-runnable code isn't run: + "if 0:", + "if __name__ == .__main__.:", + + # Don't complain about abstract methods, they aren't run: + "@(abc\\.)?abstractmethod", + + # Don't complain about TYPE_CHECKING blocks + "if TYPE_CHECKING:", +] + +ignore_errors = true + +[tool.coverage.html] +directory = "coverage_html_report" + +[tool.coverage.xml] +output = ".coverage.xml" + +################################ +# Tox +################################ +[tool.tox] +legacy_tox_ini = """ +[tox] +min_version = 4.0 +envlist = + clean, + lint, + type, + py{38,39,310,311,312}, + report + +[gh-actions] +python = + 3.8: py38 + 3.9: py39 + 3.10: py310 + 3.11: erase, py311, report + 3.12: py312 + +[testenv] +description = Run pytest with {basepython} +extras = dev +# posargs allows to run only a specific test using +# tox -e <env> -- path/to/my/test::test +commands = + pytest {posargs} + +[testenv:lint] +description = Check the code style +commands = + black --check --diff --color . + isort --check --diff --color . + flake8 --max-line-length=165 --config=/dev/null anta tests + pylint anta + pylint tests + +[testenv:type] +description = Check typing +commands = + mypy --config-file=pyproject.toml anta + mypy --config-file=pyproject.toml tests + +[testenv:clean] +description = Erase previous coverage reports +deps = coverage[toml] +skip_install = true +commands = coverage erase + +[testenv:report] +description = Generate coverage report +deps = coverage[toml] +commands = + coverage --version + coverage html --rcfile=pyproject.toml + coverage xml --rcfile=pyproject.toml +# add the following to make the report fail under some percentage +# commands = coverage report --fail-under=80 +depends = py311 +""" + +# TRYING RUFF - NOT ENABLED IN CI NOR PRE-COMMIT +[tool.ruff] +# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default. +# select = ["E", "F"] +# select all cause we like being suffering +select = ["A", "B", "C", "D", "E", "F", "G", "I", "N", "Q", "S", "T", "W", "ANN", "ARG", "BLE", "COM", "DJ", "DTZ", "EM", "ERA", "EXE", "FBT", "ICN", "INP", "ISC", "NPY", "PD", "PGH", "PIE", "PL", "PT", "PTH", "PYI", "RET", "RSE", "RUF", "SIM", "SLF", "TCH", "TID", "TRY", "UP", "YTT"] +ignore = [] + +# Allow autofix for all enabled rules (when `--fix`) is provided. +fixable = ["A", "B", "C", "D", "E", "F", "G", "I", "N", "Q", "S", "T", "W", "ANN", "ARG", "BLE", "COM", "DJ", "DTZ", "EM", "ERA", "EXE", "FBT", "ICN", "INP", "ISC", "NPY", "PD", "PGH", "PIE", "PL", "PT", "PTH", "PYI", "RET", "RSE", "RUF", "SIM", "SLF", "TCH", "TID", "TRY", "UP", "YTT"] +unfixable = [] + +# Exclude a variety of commonly ignored directories. +exclude = [ + ".bzr", + ".direnv", + ".eggs", + ".git", + ".git-rewrite", + ".hg", + ".mypy_cache", + ".nox", + ".pants.d", + ".pytype", + ".ruff_cache", + ".svn", + ".tox", + ".venv", + "__pypackages__", + "_build", + "buck-out", + "build", + "dist", + "node_modules", + "venv", +] + +# Same as Black. +line-length = 165 + +# Allow unused variables when underscore-prefixed. +dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" + +# Assume Python 3.8 as this is the lowest supported version for ANTA +target-version = "py38" + +[tool.ruff.mccabe] +# Unlike Flake8, default to a complexity level of 10. +max-complexity = 10 |