From 1ef92f6b6741ab63a74f33133b18c53e9b18eb91 Mon Sep 17 00:00:00 2001 From: Guillaume Mulocher Date: Thu, 25 Jul 2024 10:57:45 +0200 Subject: [PATCH 1/2] ci: Ignore cryptography>43.0.0 warnings (#765) * ci: Ignore cryptography>43.0.0 warnings * bump: Bump ruff to 0.5.4 * ci: Fix ruff new issues * ci: Fix mypy new issues --- .pre-commit-config.yaml | 2 +- anta/models.py | 2 +- anta/tests/routing/bgp.py | 2 +- asynceapi/device.py | 2 +- asynceapi/errors.py | 2 +- pyproject.toml | 5 ++++- 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3541244c1..a257bfd39 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -43,7 +43,7 @@ repos: - '' - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.5.2 + rev: v0.5.4 hooks: - id: ruff name: Run Ruff linter diff --git a/anta/models.py b/anta/models.py index 499fb3536..e2cf49857 100644 --- a/anta/models.py +++ b/anta/models.py @@ -57,7 +57,7 @@ class AntaTemplate: # pylint: disable=too-few-public-methods - def __init__( # noqa: PLR0913 + def __init__( self, template: str, version: Literal[1, "latest"] = "latest", diff --git a/anta/tests/routing/bgp.py b/anta/tests/routing/bgp.py index a29216b2d..7bd39ddcc 100644 --- a/anta/tests/routing/bgp.py +++ b/anta/tests/routing/bgp.py @@ -123,7 +123,7 @@ def _add_bgp_routes_failure( # Iterate over the expected BGP routes for route in bgp_routes: str_route = str(route) - failure = {"bgp_peers": {peer: {vrf: {route_type: {str_route: Any}}}}} + failure: dict[str, Any] = {"bgp_peers": {peer: {vrf: {route_type: {}}}}} # Check if the route is missing in the BGP output if str_route not in bgp_output: diff --git a/asynceapi/device.py b/asynceapi/device.py index 04ec3ab7c..ca206d3e4 100644 --- a/asynceapi/device.py +++ b/asynceapi/device.py @@ -54,7 +54,7 @@ class Device(httpx.AsyncClient): EAPI_OFMT_OPTIONS = ("json", "text") EAPI_DEFAULT_OFMT = "json" - def __init__( # noqa: PLR0913 # pylint: disable=too-many-arguments + def __init__( # pylint: disable=too-many-arguments self, host: str | None = None, username: str | None = None, diff --git a/asynceapi/errors.py b/asynceapi/errors.py index 614427a1a..020d3dc2f 100644 --- a/asynceapi/errors.py +++ b/asynceapi/errors.py @@ -24,7 +24,7 @@ class EapiCommandError(RuntimeError): not_exec: a list of commands that were not executed """ - def __init__(self, failed: str, errors: list[str], errmsg: str, passed: list[str | dict[str, Any]], not_exec: list[dict[str, Any]]) -> None: # noqa: PLR0913 # pylint: disable=too-many-arguments + def __init__(self, failed: str, errors: list[str], errmsg: str, passed: list[str | dict[str, Any]], not_exec: list[dict[str, Any]]) -> None: # pylint: disable=too-many-arguments """Initialize for the EapiCommandError exception.""" self.failed = failed self.errmsg = errmsg diff --git a/pyproject.toml b/pyproject.toml index bce5a3c5b..e8b4feba2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -71,7 +71,7 @@ dev = [ "pytest-html>=3.2.0", "pytest-metadata>=3.0.0", "pytest>=7.4.0", - "ruff>=0.5.0,<0.6.0", + "ruff>=0.5.4,<0.6.0", "tox>=4.10.0,<5.0.0", "types-PyYAML", "types-pyOpenSSL", @@ -172,6 +172,9 @@ filterwarnings = [ "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", ] From eee49de8f0d8bf506f6350bc5b418c8a7cb77c5b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 26 Jul 2024 10:07:25 +0200 Subject: [PATCH 2/2] ci: pre-commit autoupdate (#763) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.5.2 → v0.5.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.5.2...v0.5.4) - [github.com/pycqa/pylint: v3.2.5 → v3.2.6](https://github.com/pycqa/pylint/compare/v3.2.5...v3.2.6) - [github.com/pre-commit/mirrors-mypy: v1.10.1 → v1.11.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.10.1...v1.11.0) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Guillaume Mulocher --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a257bfd39..1c6282fa8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -52,7 +52,7 @@ repos: name: Run Ruff formatter - repo: https://github.com/pycqa/pylint - rev: "v3.2.5" + rev: "v3.2.6" hooks: - id: pylint name: Check code style with pylint @@ -80,7 +80,7 @@ repos: types: [text] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.10.1 + rev: v1.11.0 hooks: - id: mypy name: Check typing with mypy