summaryrefslogtreecommitdiffstats
path: root/pyproject.toml
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--pyproject.toml114
1 files changed, 71 insertions, 43 deletions
diff --git a/pyproject.toml b/pyproject.toml
index 49f699d..bc7ac71 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "anta"
-version = "v1.0.0"
+version = "v1.1.0"
readme = "docs/README.md"
authors = [{ name = "Arista Networks ANTA maintainers", email = "anta-dev@arista.com" }]
maintainers = [
@@ -20,7 +20,7 @@ description = "Arista Network Test Automation (ANTA) Framework"
license = { file = "LICENSE" }
dependencies = [
"aiocache>=0.12.2",
- "asyncssh>=2.13.2",
+ "asyncssh>=2.16",
"cvprac>=1.3.1",
"eval-type-backport>=0.1.3", # Support newer typing features in older Python versions (required until Python 3.9 support is removed)
"Jinja2>=3.1.2",
@@ -68,10 +68,14 @@ dev = [
"pytest-asyncio>=0.21.1",
"pytest-cov>=4.1.0",
"pytest-dependency",
+ "pytest-codspeed>=2.2.0",
+ "respx",
"pytest-html>=3.2.0",
+ "pytest-httpx>=0.30.0",
"pytest-metadata>=3.0.0",
"pytest>=7.4.0",
- "ruff>=0.3.7,<0.5.0",
+ "respx>=0.21.1",
+ "ruff>=0.5.4,<0.7.0",
"tox>=4.10.0,<5.0.0",
"types-PyYAML",
"types-pyOpenSSL",
@@ -80,18 +84,20 @@ dev = [
"yamllint>=1.32.0",
]
doc = [
- "fontawesome_markdown",
- "griffe",
- "mike==2.1.1",
- "mkdocs-autorefs>=0.4.1",
+ "fontawesome_markdown>=0.2.6",
+ "griffe >=1.2.0",
+ "mike==2.1.3",
+ "mkdocs>=1.6.1",
+ "mkdocs-autorefs>=1.2.0",
"mkdocs-bootswatch>=1.1",
- "mkdocs-git-revision-date-localized-plugin>=1.1.0",
+ "mkdocs-git-revision-date-localized-plugin>=1.2.8",
"mkdocs-git-revision-date-plugin>=0.3.2",
- "mkdocs-material-extensions>=1.0.3",
- "mkdocs-material>=8.3.9",
- "mkdocs>=1.3.1",
- "mkdocstrings[python]>=0.20.0",
- "mkdocs-glightbox>=0.4.0"
+ "mkdocs-glightbox>=0.4.0",
+ "mkdocs-material-extensions>=1.3.1",
+ "mkdocs-material>=9.5.34",
+ "mkdocstrings[python]>=0.26.0",
+ "mkdocstrings-python>=1.11.0",
+ "black>=24.10.0"
]
[project.urls]
@@ -113,7 +119,7 @@ namespaces = false
# Version
################################
[tool.bumpver]
-current_version = "1.0.0"
+current_version = "1.1.0"
version_pattern = "MAJOR.MINOR.PATCH"
commit_message = "bump: Version {old_version} -> {new_version}"
commit = true
@@ -166,20 +172,27 @@ addopts = "-ra -q -vv --cov --cov-report term:skip-covered --color yes"
log_level = "WARNING"
render_collapsed = true
testpaths = ["tests"]
+asyncio_mode = "auto"
+asyncio_default_fixture_loop_scope = "function"
+norecursedirs = ["tests/benchmark"] # Do not run performance testing outside of Codspeed
filterwarnings = [
- "error",
# cvprac is raising the next warning
"default:pkg_resources is deprecated:DeprecationWarning",
# Need to investigate the following - only occuring when running the full pytest suite
"ignore:Exception ignored in.*:pytest.PytestUnraisableExceptionWarning",
+ # Ignore cryptography >=43.0.0 warnings until asyncssh issue is fixed
+ "ignore:ARC4:cryptography.utils.CryptographyDeprecationWarning",
+ "ignore:TripleDES:cryptography.utils.CryptographyDeprecationWarning",
]
[tool.coverage.run]
branch = true
-source = ["anta"]
+# https://community.sonarsource.com/t/python-coverage-analysis-warning/62629/7
+include = ["anta/*", "asynceapi/*"]
parallel = true
+relative_files = true
[tool.coverage.report]
# Regexes for lines to exclude from consideration
@@ -320,11 +333,16 @@ target-version = "py39"
[tool.ruff.lint]
# select all cause we like being suffering
-select = ["ALL"]
+select = ["ALL",
+ # By enabling a convention for docstrings, ruff automatically ignore some rules that need to be
+ # added back if we want them.
+ # https://docs.astral.sh/ruff/faq/#does-ruff-support-numpy-or-google-style-docstrings
+ # TODO: Augment the numpy convention rules to make sure we add all the params
+ # Uncomment below D417
+ "D415",
+ "D417",
+]
ignore = [
- "ANN101", # Missing type annotation for `self` in method - we know what self is..
- "D203", # Ignoring conflicting D* warnings - one-blank-line-before-class
- "D213", # Ignoring conflicting D* warnings - multi-line-summary-second-line
"COM812", # Ignoring conflicting rules that may cause conflicts when used with the formatter
"ISC001", # Ignoring conflicting rules that may cause conflicts when used with the formatter
"TD002", # We don't have require authors in TODO
@@ -369,9 +387,9 @@ runtime-evaluated-base-classes = ["pydantic.BaseModel", "anta.models.AntaTest.In
"SLF001", # Lots of private member accessed for test purposes
]
"tests/units/*" = [
- "BLE001", # Do not catch blind exception: `Exception` - already disabling this in pylint
+ "ARG002", # Sometimes we need to declare unused arguments when a parameter is not used but declared in @pytest.mark.parametrize
"FBT001", # Boolean-typed positional argument in function definition
- "PLR0913", # Too many arguments to function call (8 > 5)
+ "PLR0913", # Too many arguments to function call
"PLR2004", # Magic value used in comparison, consider replacing {value} with a constant variable
"S105", # Passwords are indeed hardcoded in tests
"S106", # Passwords are indeed hardcoded in tests
@@ -380,8 +398,10 @@ runtime-evaluated-base-classes = ["pydantic.BaseModel", "anta.models.AntaTest.In
"tests/units/anta_tests/test_interfaces.py" = [
"S104", # False positive for 0.0.0.0 bindings in test inputs
]
+"tests/units/anta_tests/*" = [
+ "F401", # In this module, we import tests.units.anta_tests.test without using it to auto-generate tests
+]
"anta/*" = [
- "BLE001", # Do not catch blind exception: `Exception` - caught by other linter
"TRY400", # Use `logging.exception` instead of `logging.error` - we know what we are doing
]
"anta/cli/exec/utils.py" = [
@@ -416,43 +436,51 @@ runtime-evaluated-base-classes = ["pydantic.BaseModel", "anta.models.AntaTest.In
"anta/inventory/__init__.py" = [
"PLR0913", # Ok to have more than 5 arguments in the AntaInventory class
]
-"examples/anta_runner.py" = [ # This is an example script and linked in snippets
- "S108", # Probable insecure usage of temporary file or directory
+"examples/*.py" = [ # These are example scripts and linked in snippets
"S105", # Possible hardcoded password
+ "S106", # Possible hardcoded password assigned to argument
+ "S108", # Probable insecure usage of temporary file or directory
"INP001", # Implicit packages
+ "T201", # `print` found
+ "T203", # `pprint` found
+
]
################################
# Pylint
################################
-[tool.pylint.'MESSAGES CONTROL']
-disable = [
+[tool.pylint]
+disable = [ # Any rule listed here can be disabled: https://github.com/astral-sh/ruff/issues/970
"invalid-name",
- "fixme"
+ "fixme",
+ "unused-import",
+ "unused-argument",
+ "keyword-arg-before-vararg",
+ "protected-access",
+ "too-many-arguments",
+ "too-many-positional-arguments",
+ "wrong-import-position",
+ "pointless-statement",
+ "broad-exception-caught",
+ "line-too-long",
+ "unused-variable",
+ "redefined-builtin",
+ "global-statement",
+ "reimported",
+ "wrong-import-order",
+ "wrong-import-position",
+ "abstract-class-instantiated", # Overlap with https://mypy.readthedocs.io/en/stable/error_code_list.html#check-instantiation-of-abstract-classes-abstract
+ "unexpected-keyword-arg", # Overlap with https://mypy.readthedocs.io/en/stable/error_code_list.html#check-arguments-in-calls-call-arg and other rules
+ "no-value-for-parameter" # Overlap with https://mypy.readthedocs.io/en/stable/error_code_list.html#check-arguments-in-calls-call-arg
]
-
-[tool.pylint.DESIGN]
max-statements=61
max-returns=8
max-locals=23
-
-[tool.pylint.FORMAT]
max-line-length=165
max-module-lines=1700
-
-[tool.pylint.SIMILARITIES]
# making similarity lines limit a bit higher than default 4
min-similarity-lines=10
-
-[tool.pylint.TYPECHECK]
# https://stackoverflow.com/questions/49680191/click-and-pylint
signature-mutators="click.decorators.option"
-
-[tool.pylint.MAIN]
load-plugins="pylint_pydantic"
extension-pkg-whitelist="pydantic"
-ignore-paths = [
- "^tests/units/anta_tests/.*/data.py$",
- "^tests/units/anta_tests/routing/.*/data.py$",
- "^docs/scripts/anta_runner.py",
-]