From 7b5ed5e36ff3883c870fd6da0b45cfeb8cc2820e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 21:07:05 +0000 Subject: [PATCH 1/2] build(deps): bump ruff in the test-and-lint-dependencies group Bumps the test-and-lint-dependencies group with 1 update: [ruff](https://github.com/astral-sh/ruff). Updates `ruff` from 0.8.6 to 0.9.1 - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/0.8.6...0.9.1) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:production update-type: version-update:semver-minor dependency-group: test-and-lint-dependencies ... Signed-off-by: dependabot[bot] --- requirements/lint.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/lint.txt b/requirements/lint.txt index 0a5739b457..3264fe4071 100644 --- a/requirements/lint.txt +++ b/requirements/lint.txt @@ -6,7 +6,7 @@ # Lint tools # (We are not so interested in the specific versions of the tools: the versions # are pinned to prevent unexpected linting failures when tools update) -ruff==0.8.6 +ruff==0.9.1 mypy==1.14.1 # Required for type stubs From 5b2c041da01962a2f5f7c20cb74a860a8fbca5c4 Mon Sep 17 00:00:00 2001 From: Jussi Kukkonen Date: Tue, 14 Jan 2025 10:38:19 +0200 Subject: [PATCH 2/2] lint: Fixes from new ruff The noqa comment was added manually to avoid A005 Module `json` shadows a Python standard-library module Signed-off-by: Jussi Kukkonen --- tuf/api/_payload.py | 2 +- tuf/api/serialization/json.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tuf/api/_payload.py b/tuf/api/_payload.py index 3149102588..56852082ea 100644 --- a/tuf/api/_payload.py +++ b/tuf/api/_payload.py @@ -1222,7 +1222,7 @@ def __init__( self.number_of_bins = 2**bit_length # suffix_len is calculated based on "number_of_bins - 1" as the name # of the last bin contains the number "number_of_bins -1" as a suffix. - self.suffix_len = len(f"{self.number_of_bins-1:x}") + self.suffix_len = len(f"{self.number_of_bins - 1:x}") def __eq__(self, other: object) -> bool: if not isinstance(other, SuccinctRoles): diff --git a/tuf/api/serialization/json.py b/tuf/api/serialization/json.py index b9e964c175..a031ef8255 100644 --- a/tuf/api/serialization/json.py +++ b/tuf/api/serialization/json.py @@ -8,6 +8,9 @@ verification. """ +# We should not have shadowed stdlib json but that milk spilled already +# ruff: noqa: A005 + import json from typing import Optional