Skip to content

Commit

Permalink
chore: update ruff requirement from <0.8.0,>=0.5.4 to >=0.5.4,<0.9.0 (#…
Browse files Browse the repository at this point in the history
…932)

* chore: update ruff requirement from <0.8.0,>=0.5.4 to >=0.5.4,<0.9.0

Updates the requirements on [ruff](https://github.com/astral-sh/ruff) to permit the latest version.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](astral-sh/ruff@0.5.4...0.8.0)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Refactor(anta): Run pre-commit for ruff and apply the changes

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: gmuloc <gmulocher@arista.com>
  • Loading branch information
dependabot[bot] and gmuloc authored Nov 25, 2024
1 parent 9d375a9 commit 525917b
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ repos:
- '<!--| ~| -->'

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.4
rev: v0.8.0
hooks:
- id: ruff
name: Run Ruff linter
Expand Down
2 changes: 1 addition & 1 deletion anta/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def wrap() -> None:

cli = build_cli(exc)

__all__ = ["cli", "anta"]
__all__ = ["anta", "cli"]

if __name__ == "__main__":
cli()
2 changes: 1 addition & 1 deletion anta/result_manager/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def _update_status(self, test_status: AntaTestStatus) -> None:
if test_status == "error":
self.error_status = True
return
if self.status == "unset" or self.status == "skipped" and test_status in {"success", "failure"}:
if self.status == "unset" or (self.status == "skipped" and test_status in {"success", "failure"}):
self.status = test_status
elif self.status == "success" and test_status == "failure":
self.status = AntaTestStatus.FAILURE
Expand Down
12 changes: 4 additions & 8 deletions anta/tests/field_notices.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,11 @@ def test(self) -> None:

self.result.is_success()
incorrect_aboot_version = (
aboot_version.startswith("4.0.")
and int(aboot_version.split(".")[2]) < 7
or aboot_version.startswith("4.1.")
and int(aboot_version.split(".")[2]) < 1
(aboot_version.startswith("4.0.") and int(aboot_version.split(".")[2]) < 7)
or (aboot_version.startswith("4.1.") and int(aboot_version.split(".")[2]) < 1)
or (
aboot_version.startswith("6.0.")
and int(aboot_version.split(".")[2]) < 9
or aboot_version.startswith("6.1.")
and int(aboot_version.split(".")[2]) < 7
(aboot_version.startswith("6.0.") and int(aboot_version.split(".")[2]) < 9)
or (aboot_version.startswith("6.1.") and int(aboot_version.split(".")[2]) < 7)
)
)
if incorrect_aboot_version:
Expand Down
2 changes: 1 addition & 1 deletion asynceapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
from .device import Device
from .errors import EapiCommandError

__all__ = ["Device", "SessionConfig", "EapiCommandError"]
__all__ = ["Device", "EapiCommandError", "SessionConfig"]
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ dev = [
"pytest-metadata>=3.0.0",
"pytest>=7.4.0",
"respx>=0.21.1",
"ruff>=0.5.4,<0.8.0",
"ruff>=0.5.4,<0.9.0",
"tox>=4.10.0,<5.0.0",
"types-PyYAML",
"types-pyOpenSSL",
Expand Down
2 changes: 1 addition & 1 deletion tests/units/reporter/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@

from tests.units.result_manager.conftest import list_result_factory, result_manager, result_manager_factory, test_result_factory

__all__ = ["result_manager", "result_manager_factory", "list_result_factory", "test_result_factory"]
__all__ = ["list_result_factory", "result_manager", "result_manager_factory", "test_result_factory"]

0 comments on commit 525917b

Please sign in to comment.