From d5bbba56506b2bc4c577ac62258f93d14ab2a096 Mon Sep 17 00:00:00 2001 From: Patrick Ogenstad Date: Tue, 7 Jan 2025 19:10:12 +0100 Subject: [PATCH] Upgrade ruff=0.8.6 --- .github/workflows/ci.yml | 2 +- .pre-commit-config.yaml | 2 +- backend/infrahub/api/artifact.py | 2 +- backend/infrahub/api/dependencies.py | 4 +- backend/infrahub/api/diff/diff.py | 4 +- backend/infrahub/api/file.py | 2 +- backend/infrahub/api/menu.py | 4 +- backend/infrahub/api/query.py | 2 +- backend/infrahub/api/schema.py | 8 +-- backend/infrahub/api/transformation.py | 2 +- backend/infrahub/computed_attribute/models.py | 2 +- backend/infrahub/computed_attribute/tasks.py | 2 +- backend/infrahub/core/branch/models.py | 2 +- backend/infrahub/core/branch/tasks.py | 4 +- .../graph/m014_remove_index_attr_value.py | 2 +- .../infrahub/core/migrations/schema/tasks.py | 4 +- backend/infrahub/core/migrations/shared.py | 6 +-- .../core/schema/generated/attribute_schema.py | 4 +- .../core/schema/generated/base_node_schema.py | 4 +- .../schema/generated/relationship_schema.py | 2 +- .../core/schema/schema_branch_computed.py | 2 +- backend/infrahub/core/task/task_log.py | 2 +- backend/infrahub/core/validators/shared.py | 4 +- backend/infrahub/core/validators/tasks.py | 6 +-- backend/infrahub/database/index.py | 2 +- backend/infrahub/git/base.py | 6 +-- backend/infrahub/git/integrator.py | 2 +- .../operations/requests/proposed_change.py | 2 +- backend/infrahub/message_bus/types.py | 2 +- backend/infrahub/proposed_change/tasks.py | 2 +- backend/templates/attributeschema_imports.j2 | 4 +- backend/templates/basenodeschema_imports.j2 | 6 +-- backend/templates/genericschema_imports.j2 | 6 +-- .../templates/relationshipschema_imports.j2 | 4 +- backend/tests/unit/core/test_branch_diff.py | 22 +++++--- .../unit/graphql/mutations/test_repository.py | 9 ++-- poetry.lock | 54 +++++++++---------- pyproject.toml | 16 +++++- 38 files changed, 119 insertions(+), 96 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c06a0eb8b1..937b29fb9c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -119,7 +119,7 @@ jobs: with: submodules: true - name: "Setup environment" - run: "pip install ruff==0.7.1" + run: "pip install ruff==0.8.6" - name: "Linting: ruff check" run: "ruff check . --exclude python_sdk" - name: "Linting: ruff format" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f3a8f0b84a..13e6e3f1ed 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,7 +13,7 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.7.1 + rev: v0.8.6 hooks: # Run the linter. - id: ruff diff --git a/backend/infrahub/api/artifact.py b/backend/infrahub/api/artifact.py index dc45c03cc0..70c3e8f163 100644 --- a/backend/infrahub/api/artifact.py +++ b/backend/infrahub/api/artifact.py @@ -10,7 +10,7 @@ from infrahub.core.account import ObjectPermission from infrahub.core.constants import GLOBAL_BRANCH_NAME, InfrahubKind, PermissionAction from infrahub.core.protocols import CoreArtifactDefinition -from infrahub.database import InfrahubDatabase # noqa: TCH001 +from infrahub.database import InfrahubDatabase # noqa: TC001 from infrahub.exceptions import NodeNotFoundError from infrahub.git.models import RequestArtifactDefinitionGenerate from infrahub.log import get_logger diff --git a/backend/infrahub/api/dependencies.py b/backend/infrahub/api/dependencies.py index bac30f3db8..07078f212f 100644 --- a/backend/infrahub/api/dependencies.py +++ b/backend/infrahub/api/dependencies.py @@ -8,10 +8,10 @@ from infrahub import config from infrahub.auth import AccountSession, authentication_token, validate_jwt_access_token, validate_jwt_refresh_token -from infrahub.core.branch import Branch # noqa: TCH001 +from infrahub.core.branch import Branch # noqa: TC001 from infrahub.core.registry import registry from infrahub.core.timestamp import Timestamp -from infrahub.database import InfrahubDatabase # noqa: TCH001 +from infrahub.database import InfrahubDatabase # noqa: TC001 from infrahub.exceptions import AuthorizationError from infrahub.permissions import PermissionManager diff --git a/backend/infrahub/api/diff/diff.py b/backend/infrahub/api/diff/diff.py index 19347d57b5..97ee1e328c 100644 --- a/backend/infrahub/api/diff/diff.py +++ b/backend/infrahub/api/diff/diff.py @@ -7,7 +7,7 @@ from infrahub.api.dependencies import get_branch_dep, get_current_user, get_db from infrahub.core import registry -from infrahub.core.branch import Branch # noqa: TCH001 +from infrahub.core.branch import Branch # noqa: TC001 from infrahub.core.diff.artifacts.calculator import ArtifactDiffCalculator from infrahub.core.diff.branch_differ import BranchDiffer from infrahub.core.diff.model.diff import ( @@ -15,7 +15,7 @@ BranchDiffFile, BranchDiffRepository, ) -from infrahub.database import InfrahubDatabase # noqa: TCH001 +from infrahub.database import InfrahubDatabase # noqa: TC001 if TYPE_CHECKING: from infrahub.services import InfrahubServices diff --git a/backend/infrahub/api/file.py b/backend/infrahub/api/file.py index 0e2f6d4f67..f14bd05fcd 100644 --- a/backend/infrahub/api/file.py +++ b/backend/infrahub/api/file.py @@ -8,7 +8,7 @@ from infrahub.api.dependencies import BranchParams, get_branch_params, get_current_user, get_db from infrahub.core.constants import InfrahubKind from infrahub.core.manager import NodeManager -from infrahub.database import InfrahubDatabase # noqa: TCH001 +from infrahub.database import InfrahubDatabase # noqa: TC001 from infrahub.exceptions import CommitNotFoundError, PropagatedFromWorkerError from infrahub.message_bus.messages import GitFileGet, GitFileGetResponse diff --git a/backend/infrahub/api/menu.py b/backend/infrahub/api/menu.py index 5c5ac057d1..f0a69298ad 100644 --- a/backend/infrahub/api/menu.py +++ b/backend/infrahub/api/menu.py @@ -6,11 +6,11 @@ from infrahub.api.dependencies import get_branch_dep, get_db, get_permission_manager from infrahub.core import registry -from infrahub.core.branch import Branch # noqa: TCH001 +from infrahub.core.branch import Branch # noqa: TC001 from infrahub.core.protocols import CoreMenuItem from infrahub.log import get_logger from infrahub.menu.generator import generate_restricted_menu -from infrahub.menu.models import Menu # noqa: TCH001 +from infrahub.menu.models import Menu # noqa: TC001 if TYPE_CHECKING: from infrahub.database import InfrahubDatabase diff --git a/backend/infrahub/api/query.py b/backend/infrahub/api/query.py index faac11ee8e..efba4e2df6 100644 --- a/backend/infrahub/api/query.py +++ b/backend/infrahub/api/query.py @@ -10,7 +10,7 @@ from infrahub.core import registry from infrahub.core.constants import InfrahubKind from infrahub.core.protocols import CoreGraphQLQuery -from infrahub.database import InfrahubDatabase # noqa: TCH001 +from infrahub.database import InfrahubDatabase # noqa: TC001 from infrahub.graphql.analyzer import InfrahubGraphQLQueryAnalyzer from infrahub.graphql.api.dependencies import build_graphql_query_permission_checker from infrahub.graphql.initialization import prepare_graphql_params diff --git a/backend/infrahub/api/schema.py b/backend/infrahub/api/schema.py index a8efeaf7e9..39c6659e36 100644 --- a/backend/infrahub/api/schema.py +++ b/backend/infrahub/api/schema.py @@ -17,21 +17,21 @@ from infrahub.api.exceptions import SchemaNotValidError from infrahub.core import registry from infrahub.core.account import GlobalPermission -from infrahub.core.branch import Branch # noqa: TCH001 +from infrahub.core.branch import Branch # noqa: TC001 from infrahub.core.constants import GLOBAL_BRANCH_NAME, GlobalPermissions, PermissionDecision from infrahub.core.migrations.schema.models import SchemaApplyMigrationData -from infrahub.core.models import ( # noqa: TCH001 +from infrahub.core.models import ( # noqa: TC001 SchemaBranchHash, SchemaDiff, SchemaUpdateValidationResult, ) from infrahub.core.schema import GenericSchema, MainSchemaTypes, NodeSchema, ProfileSchema, SchemaRoot -from infrahub.core.schema.constants import SchemaNamespace # noqa: TCH001 +from infrahub.core.schema.constants import SchemaNamespace # noqa: TC001 from infrahub.core.validators.models.validate_migration import ( SchemaValidateMigrationData, SchemaValidatorPathResponseData, ) -from infrahub.database import InfrahubDatabase # noqa: TCH001 +from infrahub.database import InfrahubDatabase # noqa: TC001 from infrahub.events import EventMeta from infrahub.events.schema_action import SchemaUpdatedEvent from infrahub.exceptions import MigrationError diff --git a/backend/infrahub/api/transformation.py b/backend/infrahub/api/transformation.py index b0c8111758..0418588150 100644 --- a/backend/infrahub/api/transformation.py +++ b/backend/infrahub/api/transformation.py @@ -19,7 +19,7 @@ CoreTransformJinja2, CoreTransformPython, ) -from infrahub.database import InfrahubDatabase # noqa: TCH001 +from infrahub.database import InfrahubDatabase # noqa: TC001 from infrahub.exceptions import TransformError from infrahub.graphql.initialization import prepare_graphql_params from infrahub.graphql.utils import extract_data diff --git a/backend/infrahub/computed_attribute/models.py b/backend/infrahub/computed_attribute/models.py index cb5e97ca3b..5da9deac6d 100644 --- a/backend/infrahub/computed_attribute/models.py +++ b/backend/infrahub/computed_attribute/models.py @@ -4,7 +4,7 @@ from dataclasses import dataclass, field from typing import TYPE_CHECKING -from prefect.events.schemas.automations import Automation # noqa: TCH002 +from prefect.events.schemas.automations import Automation # noqa: TC002 from pydantic import BaseModel, Field from typing_extensions import Self diff --git a/backend/infrahub/computed_attribute/tasks.py b/backend/infrahub/computed_attribute/tasks.py index d5883601ff..c1b7a2a192 100644 --- a/backend/infrahub/computed_attribute/tasks.py +++ b/backend/infrahub/computed_attribute/tasks.py @@ -4,7 +4,7 @@ from typing import TYPE_CHECKING, Any import ujson -from infrahub_sdk.protocols import CoreNode # noqa: TCH002 +from infrahub_sdk.protocols import CoreNode # noqa: TC002 from prefect import flow from prefect.automations import AutomationCore from prefect.client.orchestration import get_client diff --git a/backend/infrahub/core/branch/models.py b/backend/infrahub/core/branch/models.py index 0e8793c4f6..e4298483fa 100644 --- a/backend/infrahub/core/branch/models.py +++ b/backend/infrahub/core/branch/models.py @@ -8,7 +8,7 @@ from infrahub.core.constants import ( GLOBAL_BRANCH_NAME, ) -from infrahub.core.models import SchemaBranchHash # noqa: TCH001 +from infrahub.core.models import SchemaBranchHash # noqa: TC001 from infrahub.core.node.standard import StandardNode from infrahub.core.query import QueryType from infrahub.core.query.branch import ( diff --git a/backend/infrahub/core/branch/tasks.py b/backend/infrahub/core/branch/tasks.py index 1dcef5cdf4..41f5796d05 100644 --- a/backend/infrahub/core/branch/tasks.py +++ b/backend/infrahub/core/branch/tasks.py @@ -8,7 +8,7 @@ from prefect.automations import AutomationCore from prefect.client.orchestration import get_client from prefect.client.schemas.filters import DeploymentFilter, DeploymentFilterName -from prefect.client.schemas.objects import State # noqa: TCH002 +from prefect.client.schemas.objects import State # noqa: TC002 from prefect.events.actions import RunDeployment from prefect.events.schemas.automations import EventTrigger, Posture from prefect.states import Completed, Failed @@ -30,7 +30,7 @@ from infrahub.dependencies.registry import get_component_registry from infrahub.events.branch_action import BranchCreateEvent, BranchDeleteEvent, BranchRebaseEvent from infrahub.exceptions import BranchNotFoundError, MergeFailedError, ValidationError -from infrahub.graphql.mutations.models import BranchCreateModel # noqa: TCH001 +from infrahub.graphql.mutations.models import BranchCreateModel # noqa: TC001 from infrahub.log import get_log_data from infrahub.message_bus import Meta, messages from infrahub.services import services diff --git a/backend/infrahub/core/migrations/graph/m014_remove_index_attr_value.py b/backend/infrahub/core/migrations/graph/m014_remove_index_attr_value.py index 12cd0983c0..834c4b367c 100644 --- a/backend/infrahub/core/migrations/graph/m014_remove_index_attr_value.py +++ b/backend/infrahub/core/migrations/graph/m014_remove_index_attr_value.py @@ -3,7 +3,7 @@ from typing import TYPE_CHECKING, Sequence from infrahub.core.migrations.shared import MigrationResult -from infrahub.core.query import Query # noqa: TCH001 +from infrahub.core.query import Query # noqa: TC001 from infrahub.database import DatabaseType from infrahub.database.constants import IndexType from infrahub.database.index import IndexItem diff --git a/backend/infrahub/core/migrations/schema/tasks.py b/backend/infrahub/core/migrations/schema/tasks.py index 8d6050e585..0985629f1e 100644 --- a/backend/infrahub/core/migrations/schema/tasks.py +++ b/backend/infrahub/core/migrations/schema/tasks.py @@ -7,9 +7,9 @@ from prefect.cache_policies import NONE from prefect.logging import get_run_logger -from infrahub.core.branch import Branch # noqa: TCH001 +from infrahub.core.branch import Branch # noqa: TC001 from infrahub.core.migrations import MIGRATION_MAP -from infrahub.core.path import SchemaPath # noqa: TCH001 +from infrahub.core.path import SchemaPath # noqa: TC001 from infrahub.services import services from infrahub.workflows.utils import add_branch_tag diff --git a/backend/infrahub/core/migrations/shared.py b/backend/infrahub/core/migrations/shared.py index 20cf7b3f46..f62623920c 100644 --- a/backend/infrahub/core/migrations/shared.py +++ b/backend/infrahub/core/migrations/shared.py @@ -6,8 +6,8 @@ from typing_extensions import Self from infrahub.core import registry -from infrahub.core.path import SchemaPath # noqa: TCH001 -from infrahub.core.query import Query # noqa: TCH001 +from infrahub.core.path import SchemaPath # noqa: TC001 +from infrahub.core.query import Query # noqa: TC001 from infrahub.core.schema import ( AttributeSchema, GenericSchema, @@ -17,7 +17,7 @@ internal_schema, ) -from .query import MigrationQuery # noqa: TCH001 +from .query import MigrationQuery # noqa: TC001 if TYPE_CHECKING: from infrahub.core.branch import Branch diff --git a/backend/infrahub/core/schema/generated/attribute_schema.py b/backend/infrahub/core/schema/generated/attribute_schema.py index b28ce0b824..8969bcb68d 100644 --- a/backend/infrahub/core/schema/generated/attribute_schema.py +++ b/backend/infrahub/core/schema/generated/attribute_schema.py @@ -8,8 +8,8 @@ from infrahub.core.constants import AllowOverrideType, HashableModelState from infrahub.core.models import HashableModel -from infrahub.core.schema.computed_attribute import ComputedAttribute # noqa: TCH001 -from infrahub.core.schema.dropdown import DropdownChoice # noqa: TCH001 +from infrahub.core.schema.computed_attribute import ComputedAttribute # noqa: TC001 +from infrahub.core.schema.dropdown import DropdownChoice # noqa: TC001 if TYPE_CHECKING: from infrahub.core.constants import BranchSupportType diff --git a/backend/infrahub/core/schema/generated/base_node_schema.py b/backend/infrahub/core/schema/generated/base_node_schema.py index 91f86ac8a6..50e5268c78 100644 --- a/backend/infrahub/core/schema/generated/base_node_schema.py +++ b/backend/infrahub/core/schema/generated/base_node_schema.py @@ -8,8 +8,8 @@ from infrahub.core.constants import BranchSupportType, HashableModelState from infrahub.core.models import HashableModel -from infrahub.core.schema.attribute_schema import AttributeSchema # noqa: TCH001 -from infrahub.core.schema.relationship_schema import RelationshipSchema # noqa: TCH001 +from infrahub.core.schema.attribute_schema import AttributeSchema # noqa: TC001 +from infrahub.core.schema.relationship_schema import RelationshipSchema # noqa: TC001 class GeneratedBaseNodeSchema(HashableModel): diff --git a/backend/infrahub/core/schema/generated/relationship_schema.py b/backend/infrahub/core/schema/generated/relationship_schema.py index 8efa9a2e35..8f40dc538b 100644 --- a/backend/infrahub/core/schema/generated/relationship_schema.py +++ b/backend/infrahub/core/schema/generated/relationship_schema.py @@ -14,7 +14,7 @@ RelationshipDeleteBehavior, RelationshipDirection, RelationshipKind, -) +) # noqa: TC001 from infrahub.core.models import HashableModel diff --git a/backend/infrahub/core/schema/schema_branch_computed.py b/backend/infrahub/core/schema/schema_branch_computed.py index 7ad66d47f5..db394eb8ad 100644 --- a/backend/infrahub/core/schema/schema_branch_computed.py +++ b/backend/infrahub/core/schema/schema_branch_computed.py @@ -6,7 +6,7 @@ from pydantic import BaseModel, Field -from infrahub.core.schema import AttributeSchema # noqa: TCH001 +from infrahub.core.schema import AttributeSchema # noqa: TC001 if TYPE_CHECKING: from infrahub.core.schema import NodeSchema, SchemaAttributePath diff --git a/backend/infrahub/core/task/task_log.py b/backend/infrahub/core/task/task_log.py index e451c15b7d..2fddd6c7fc 100644 --- a/backend/infrahub/core/task/task_log.py +++ b/backend/infrahub/core/task/task_log.py @@ -4,7 +4,7 @@ from pydantic import ConfigDict, Field -from infrahub.core.constants import Severity # noqa: TCH001 +from infrahub.core.constants import Severity # noqa: TC001 from infrahub.core.node.standard import StandardNode from infrahub.core.query.task_log import TaskLogNodeCreateQuery from infrahub.core.timestamp import current_timestamp diff --git a/backend/infrahub/core/validators/shared.py b/backend/infrahub/core/validators/shared.py index 2d1f91bd22..4ae09cc00e 100644 --- a/backend/infrahub/core/validators/shared.py +++ b/backend/infrahub/core/validators/shared.py @@ -2,9 +2,9 @@ from typing import Any, Union -from infrahub.core.path import GroupedDataPaths, SchemaPath # noqa: TCH001 +from infrahub.core.path import GroupedDataPaths, SchemaPath # noqa: TC001 from infrahub.core.query import Query, QueryType -from infrahub.core.schema import AttributeSchema, GenericSchema, NodeSchema, RelationshipSchema # noqa: TCH001 +from infrahub.core.schema import AttributeSchema, GenericSchema, NodeSchema, RelationshipSchema # noqa: TC001 class SchemaValidatorQuery(Query): diff --git a/backend/infrahub/core/validators/tasks.py b/backend/infrahub/core/validators/tasks.py index 9ff762f08e..8cb03dc572 100644 --- a/backend/infrahub/core/validators/tasks.py +++ b/backend/infrahub/core/validators/tasks.py @@ -5,9 +5,9 @@ from prefect.cache_policies import NONE from prefect.logging import get_run_logger -from infrahub.core.branch import Branch # noqa: TCH001 -from infrahub.core.path import SchemaPath # noqa: TCH001 -from infrahub.core.schema import GenericSchema, NodeSchema # noqa: TCH001 +from infrahub.core.branch import Branch # noqa: TC001 +from infrahub.core.path import SchemaPath # noqa: TC001 +from infrahub.core.schema import GenericSchema, NodeSchema # noqa: TC001 from infrahub.core.validators.aggregated_checker import AggregatedConstraintChecker from infrahub.core.validators.model import ( SchemaConstraintValidatorRequest, diff --git a/backend/infrahub/database/index.py b/backend/infrahub/database/index.py index 3f0ec27718..ac0918e9be 100644 --- a/backend/infrahub/database/index.py +++ b/backend/infrahub/database/index.py @@ -5,7 +5,7 @@ from pydantic import BaseModel -from .constants import EntityType, IndexType # noqa: TCH001 +from .constants import EntityType, IndexType # noqa: TC001 if TYPE_CHECKING: from infrahub.database import InfrahubDatabase diff --git a/backend/infrahub/git/base.py b/backend/infrahub/git/base.py index 8fa35101b5..8c700e58fd 100644 --- a/backend/infrahub/git/base.py +++ b/backend/infrahub/git/base.py @@ -4,13 +4,13 @@ from abc import ABC, abstractmethod from pathlib import Path from typing import TYPE_CHECKING, NoReturn, Optional, Union -from uuid import UUID # noqa: TCH003 +from uuid import UUID # noqa: TC003 import git from git import Blob, Repo from git.exc import GitCommandError, InvalidGitRepositoryError from git.refs.remote import RemoteReference -from infrahub_sdk import InfrahubClient # noqa: TCH002 +from infrahub_sdk import InfrahubClient # noqa: TC002 from prefect import Flow, Task from pydantic import BaseModel, ConfigDict, Field from pydantic import ValidationError as PydanticValidationError @@ -29,7 +29,7 @@ from infrahub.git.directory import get_repositories_directory, initialize_repositories_directory from infrahub.git.worktree import Worktree from infrahub.log import get_logger -from infrahub.services import InfrahubServices # noqa: TCH001 +from infrahub.services import InfrahubServices # noqa: TC001 if TYPE_CHECKING: from infrahub_sdk.branch import BranchData diff --git a/backend/infrahub/git/integrator.py b/backend/infrahub/git/integrator.py index 99db5044d4..08f97209ec 100644 --- a/backend/infrahub/git/integrator.py +++ b/backend/infrahub/git/integrator.py @@ -8,7 +8,7 @@ import jinja2 import ujson import yaml -from infrahub_sdk import InfrahubClient # noqa: TCH002 +from infrahub_sdk import InfrahubClient # noqa: TC002 from infrahub_sdk.exceptions import ValidationError from infrahub_sdk.protocols import ( CoreArtifact, diff --git a/backend/infrahub/message_bus/operations/requests/proposed_change.py b/backend/infrahub/message_bus/operations/requests/proposed_change.py index 8ef4807e1b..dd90b4f383 100644 --- a/backend/infrahub/message_bus/operations/requests/proposed_change.py +++ b/backend/infrahub/message_bus/operations/requests/proposed_change.py @@ -26,7 +26,7 @@ RequestProposedChangeSchemaIntegrity, RequestProposedChangeUserTests, ) -from infrahub.services import InfrahubServices # noqa: TCH001 +from infrahub.services import InfrahubServices # noqa: TC001 from infrahub.workflows.catalogue import ( REQUEST_PROPOSED_CHANGE_DATA_INTEGRITY, REQUEST_PROPOSED_CHANGE_REPOSITORY_CHECKS, diff --git a/backend/infrahub/message_bus/types.py b/backend/infrahub/message_bus/types.py index 51e515a6c6..eee17b16df 100644 --- a/backend/infrahub/message_bus/types.py +++ b/backend/infrahub/message_bus/types.py @@ -3,7 +3,7 @@ import re from enum import Enum -from infrahub_sdk.diff import NodeDiff # noqa: TCH002 +from infrahub_sdk.diff import NodeDiff # noqa: TC002 from pydantic import BaseModel, Field from infrahub.core.constants import InfrahubKind, RepositoryInternalStatus diff --git a/backend/infrahub/proposed_change/tasks.py b/backend/infrahub/proposed_change/tasks.py index b9dcc92030..65b5957e40 100644 --- a/backend/infrahub/proposed_change/tasks.py +++ b/backend/infrahub/proposed_change/tasks.py @@ -11,7 +11,7 @@ from prefect import flow, task from prefect.cache_policies import NONE from prefect.client.schemas.objects import ( - State, # noqa: TCH002 + State, # noqa: TC002 ) from prefect.logging import get_run_logger from prefect.states import Completed, Failed diff --git a/backend/templates/attributeschema_imports.j2 b/backend/templates/attributeschema_imports.j2 index 28ecffe08f..206398a187 100644 --- a/backend/templates/attributeschema_imports.j2 +++ b/backend/templates/attributeschema_imports.j2 @@ -4,8 +4,8 @@ from typing import Optional, Any, TYPE_CHECKING from infrahub.core.models import HashableModel from infrahub.core.constants import AllowOverrideType, ComputedAttributeKind, HashableModelState -from infrahub.core.schema.computed_attribute import ComputedAttribute # noqa: TCH001 -from infrahub.core.schema.dropdown import DropdownChoice # noqa: TCH001 +from infrahub.core.schema.computed_attribute import ComputedAttribute # noqa: TC001 +from infrahub.core.schema.dropdown import DropdownChoice # noqa: TC001 if TYPE_CHECKING: from infrahub.core.constants import BranchSupportType diff --git a/backend/templates/basenodeschema_imports.j2 b/backend/templates/basenodeschema_imports.j2 index 0ed378fb92..058db03e75 100644 --- a/backend/templates/basenodeschema_imports.j2 +++ b/backend/templates/basenodeschema_imports.j2 @@ -2,6 +2,6 @@ from typing import Optional from infrahub.core.constants import BranchSupportType, HashableModelState from infrahub.core.models import HashableModel -from infrahub.core.schema.attribute_schema import AttributeSchema # noqa: TCH001 -from infrahub.core.schema.filter import FilterSchema # noqa: TCH001 -from infrahub.core.schema.relationship_schema import RelationshipSchema # noqa: TCH001 \ No newline at end of file +from infrahub.core.schema.attribute_schema import AttributeSchema # noqa: TC001 +from infrahub.core.schema.filter import FilterSchema # noqa: TC001 +from infrahub.core.schema.relationship_schema import RelationshipSchema # noqa: TC001 \ No newline at end of file diff --git a/backend/templates/genericschema_imports.j2 b/backend/templates/genericschema_imports.j2 index d2136b57e2..e194e2bdd5 100644 --- a/backend/templates/genericschema_imports.j2 +++ b/backend/templates/genericschema_imports.j2 @@ -1,7 +1,7 @@ from typing import Optional from infrahub.core.constants import BranchSupportType, HashableModelState -from infrahub.core.schema.attribute_schema import AttributeSchema # noqa: TCH001 +from infrahub.core.schema.attribute_schema import AttributeSchema # noqa: TC001 from infrahub.core.schema.basenode_schema import BaseNodeSchema -from infrahub.core.schema.filter import FilterSchema # noqa: TCH001 -from infrahub.core.schema.relationship_schema import RelationshipSchema # noqa: TCH001 +from infrahub.core.schema.filter import FilterSchema # noqa: TC001 +from infrahub.core.schema.relationship_schema import RelationshipSchema # noqa: TC001 diff --git a/backend/templates/relationshipschema_imports.j2 b/backend/templates/relationshipschema_imports.j2 index ef8421fc66..3fc373cb2d 100644 --- a/backend/templates/relationshipschema_imports.j2 +++ b/backend/templates/relationshipschema_imports.j2 @@ -1,7 +1,7 @@ from typing import Optional, TYPE_CHECKING -from infrahub.core.constants import AllowOverrideType, BranchSupportType, RelationshipKind, RelationshipCardinality, RelationshipDeleteBehavior, RelationshipDirection, HashableModelState # noqa: TCH001 +from infrahub.core.constants import AllowOverrideType, BranchSupportType, RelationshipKind, RelationshipCardinality, RelationshipDeleteBehavior, RelationshipDirection, HashableModelState # noqa: TC001 from infrahub.core.models import HashableModel if TYPE_CHECKING: - from infrahub.core.schema.filter import FilterSchema # noqa: TCH001 + from infrahub.core.schema.filter import FilterSchema # noqa: TC001 diff --git a/backend/tests/unit/core/test_branch_diff.py b/backend/tests/unit/core/test_branch_diff.py index d471e3563d..359569aa58 100644 --- a/backend/tests/unit/core/test_branch_diff.py +++ b/backend/tests/unit/core/test_branch_diff.py @@ -126,10 +126,13 @@ def execute_workflow_side_effect(workflow, parameters): return model service = InfrahubServices(database=db, workflow=WorkflowLocalExecution()) - with patch( - "infrahub.services.adapters.workflow.local.WorkflowLocalExecution.execute_workflow", - side_effect=execute_workflow_side_effect, - ), init_global_service(service): + with ( + patch( + "infrahub.services.adapters.workflow.local.WorkflowLocalExecution.execute_workflow", + side_effect=execute_workflow_side_effect, + ), + init_global_service(service), + ): branch2 = await create_branch(branch_name="branch2", db=db) diff = await BranchDiffer.init(branch=branch2, db=db, service=services.service) @@ -166,10 +169,13 @@ def execute_workflow_side_effect(workflow, parameters): return model service = InfrahubServices(database=db, workflow=WorkflowLocalExecution()) - with patch( - "infrahub.services.adapters.workflow.local.WorkflowLocalExecution.execute_workflow", - side_effect=execute_workflow_side_effect, - ), init_global_service(service): + with ( + patch( + "infrahub.services.adapters.workflow.local.WorkflowLocalExecution.execute_workflow", + side_effect=execute_workflow_side_effect, + ), + init_global_service(service), + ): branch2 = await create_branch(branch_name="branch2", db=db) repos_list = await NodeManager.query(db=db, schema=InfrahubKind.REPOSITORY, branch=branch2) diff --git a/backend/tests/unit/graphql/mutations/test_repository.py b/backend/tests/unit/graphql/mutations/test_repository.py index 2672d4aca0..82dce92113 100644 --- a/backend/tests/unit/graphql/mutations/test_repository.py +++ b/backend/tests/unit/graphql/mutations/test_repository.py @@ -32,9 +32,12 @@ async def test_trigger_repository_import( service = InfrahubServices(database=db, message_bus=recorder, workflow=WorkflowLocalExecution()) # TODO: Removing this mock triggers issue: `Invalid file system for test-edge-demo, local directory ... missing` - with init_global_service(service), patch( - "infrahub.services.adapters.workflow.local.WorkflowLocalExecution.submit_workflow" - ) as mock_submit_workflow: + with ( + init_global_service(service), + patch( + "infrahub.services.adapters.workflow.local.WorkflowLocalExecution.submit_workflow" + ) as mock_submit_workflow, + ): RUN_REIMPORT = """ mutation InfrahubRepositoryProcess($id: String!) { InfrahubRepositoryProcess(data: {id: $id}) { diff --git a/poetry.lock b/poetry.lock index 2f600edd48..765266db1a 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.5 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.4 and should not be changed by hand. [[package]] name = "aio-pika" @@ -4675,24 +4675,24 @@ python-versions = ">=3.6" files = [ {file = "ruamel.yaml.clib-0.2.8-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:b42169467c42b692c19cf539c38d4602069d8c1505e97b86387fcf7afb766e1d"}, {file = "ruamel.yaml.clib-0.2.8-cp310-cp310-macosx_13_0_arm64.whl", hash = "sha256:07238db9cbdf8fc1e9de2489a4f68474e70dffcb32232db7c08fa61ca0c7c462"}, + {file = "ruamel.yaml.clib-0.2.8-cp310-cp310-manylinux2014_aarch64.whl", hash = "sha256:d92f81886165cb14d7b067ef37e142256f1c6a90a65cd156b063a43da1708cfd"}, {file = "ruamel.yaml.clib-0.2.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:fff3573c2db359f091e1589c3d7c5fc2f86f5bdb6f24252c2d8e539d4e45f412"}, - {file = "ruamel.yaml.clib-0.2.8-cp310-cp310-manylinux_2_24_aarch64.whl", hash = "sha256:aa2267c6a303eb483de8d02db2871afb5c5fc15618d894300b88958f729ad74f"}, {file = "ruamel.yaml.clib-0.2.8-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:840f0c7f194986a63d2c2465ca63af8ccbbc90ab1c6001b1978f05119b5e7334"}, {file = "ruamel.yaml.clib-0.2.8-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:024cfe1fc7c7f4e1aff4a81e718109e13409767e4f871443cbff3dba3578203d"}, {file = "ruamel.yaml.clib-0.2.8-cp310-cp310-win32.whl", hash = "sha256:c69212f63169ec1cfc9bb44723bf2917cbbd8f6191a00ef3410f5a7fe300722d"}, {file = "ruamel.yaml.clib-0.2.8-cp310-cp310-win_amd64.whl", hash = "sha256:cabddb8d8ead485e255fe80429f833172b4cadf99274db39abc080e068cbcc31"}, {file = "ruamel.yaml.clib-0.2.8-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:bef08cd86169d9eafb3ccb0a39edb11d8e25f3dae2b28f5c52fd997521133069"}, {file = "ruamel.yaml.clib-0.2.8-cp311-cp311-macosx_13_0_arm64.whl", hash = "sha256:b16420e621d26fdfa949a8b4b47ade8810c56002f5389970db4ddda51dbff248"}, + {file = "ruamel.yaml.clib-0.2.8-cp311-cp311-manylinux2014_aarch64.whl", hash = "sha256:b5edda50e5e9e15e54a6a8a0070302b00c518a9d32accc2346ad6c984aacd279"}, {file = "ruamel.yaml.clib-0.2.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:25c515e350e5b739842fc3228d662413ef28f295791af5e5110b543cf0b57d9b"}, - {file = "ruamel.yaml.clib-0.2.8-cp311-cp311-manylinux_2_24_aarch64.whl", hash = "sha256:1707814f0d9791df063f8c19bb51b0d1278b8e9a2353abbb676c2f685dee6afe"}, {file = "ruamel.yaml.clib-0.2.8-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:46d378daaac94f454b3a0e3d8d78cafd78a026b1d71443f4966c696b48a6d899"}, {file = "ruamel.yaml.clib-0.2.8-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:09b055c05697b38ecacb7ac50bdab2240bfca1a0c4872b0fd309bb07dc9aa3a9"}, {file = "ruamel.yaml.clib-0.2.8-cp311-cp311-win32.whl", hash = "sha256:53a300ed9cea38cf5a2a9b069058137c2ca1ce658a874b79baceb8f892f915a7"}, {file = "ruamel.yaml.clib-0.2.8-cp311-cp311-win_amd64.whl", hash = "sha256:c2a72e9109ea74e511e29032f3b670835f8a59bbdc9ce692c5b4ed91ccf1eedb"}, {file = "ruamel.yaml.clib-0.2.8-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:ebc06178e8821efc9692ea7544aa5644217358490145629914d8020042c24aa1"}, {file = "ruamel.yaml.clib-0.2.8-cp312-cp312-macosx_13_0_arm64.whl", hash = "sha256:edaef1c1200c4b4cb914583150dcaa3bc30e592e907c01117c08b13a07255ec2"}, + {file = "ruamel.yaml.clib-0.2.8-cp312-cp312-manylinux2014_aarch64.whl", hash = "sha256:7048c338b6c86627afb27faecf418768acb6331fc24cfa56c93e8c9780f815fa"}, {file = "ruamel.yaml.clib-0.2.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d176b57452ab5b7028ac47e7b3cf644bcfdc8cacfecf7e71759f7f51a59e5c92"}, - {file = "ruamel.yaml.clib-0.2.8-cp312-cp312-manylinux_2_24_aarch64.whl", hash = "sha256:1dc67314e7e1086c9fdf2680b7b6c2be1c0d8e3a8279f2e993ca2a7545fecf62"}, {file = "ruamel.yaml.clib-0.2.8-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:3213ece08ea033eb159ac52ae052a4899b56ecc124bb80020d9bbceeb50258e9"}, {file = "ruamel.yaml.clib-0.2.8-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:aab7fd643f71d7946f2ee58cc88c9b7bfc97debd71dcc93e03e2d174628e7e2d"}, {file = "ruamel.yaml.clib-0.2.8-cp312-cp312-win32.whl", hash = "sha256:5c365d91c88390c8d0a8545df0b5857172824b1c604e867161e6b3d59a827eaa"}, @@ -4700,7 +4700,7 @@ files = [ {file = "ruamel.yaml.clib-0.2.8-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:a5aa27bad2bb83670b71683aae140a1f52b0857a2deff56ad3f6c13a017a26ed"}, {file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:c58ecd827313af6864893e7af0a3bb85fd529f862b6adbefe14643947cfe2942"}, {file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-macosx_12_0_arm64.whl", hash = "sha256:f481f16baec5290e45aebdc2a5168ebc6d35189ae6fea7a58787613a25f6e875"}, - {file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-manylinux_2_24_aarch64.whl", hash = "sha256:77159f5d5b5c14f7c34073862a6b7d34944075d9f93e681638f6d753606c6ce6"}, + {file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:3fcc54cb0c8b811ff66082de1680b4b14cf8a81dce0d4fbf665c2265a81e07a1"}, {file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:7f67a1ee819dc4562d444bbafb135832b0b909f81cc90f7aa00260968c9ca1b3"}, {file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:4ecbf9c3e19f9562c7fdd462e8d18dd902a47ca046a2e64dba80699f0b6c09b7"}, {file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:87ea5ff66d8064301a154b3933ae406b0863402a799b16e4a1d24d9fbbcbe0d3"}, @@ -4708,7 +4708,7 @@ files = [ {file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-win_amd64.whl", hash = "sha256:3f215c5daf6a9d7bbed4a0a4f760f3113b10e82ff4c5c44bec20a68c8014f675"}, {file = "ruamel.yaml.clib-0.2.8-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1b617618914cb00bf5c34d4357c37aa15183fa229b24767259657746c9077615"}, {file = "ruamel.yaml.clib-0.2.8-cp38-cp38-macosx_12_0_arm64.whl", hash = "sha256:a6a9ffd280b71ad062eae53ac1659ad86a17f59a0fdc7699fd9be40525153337"}, - {file = "ruamel.yaml.clib-0.2.8-cp38-cp38-manylinux_2_24_aarch64.whl", hash = "sha256:305889baa4043a09e5b76f8e2a51d4ffba44259f6b4c72dec8ca56207d9c6fe1"}, + {file = "ruamel.yaml.clib-0.2.8-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:665f58bfd29b167039f714c6998178d27ccd83984084c286110ef26b230f259f"}, {file = "ruamel.yaml.clib-0.2.8-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:700e4ebb569e59e16a976857c8798aee258dceac7c7d6b50cab63e080058df91"}, {file = "ruamel.yaml.clib-0.2.8-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:e2b4c44b60eadec492926a7270abb100ef9f72798e18743939bdbf037aab8c28"}, {file = "ruamel.yaml.clib-0.2.8-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:e79e5db08739731b0ce4850bed599235d601701d5694c36570a99a0c5ca41a9d"}, @@ -4716,7 +4716,7 @@ files = [ {file = "ruamel.yaml.clib-0.2.8-cp38-cp38-win_amd64.whl", hash = "sha256:56f4252222c067b4ce51ae12cbac231bce32aee1d33fbfc9d17e5b8d6966c312"}, {file = "ruamel.yaml.clib-0.2.8-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:03d1162b6d1df1caa3a4bd27aa51ce17c9afc2046c31b0ad60a0a96ec22f8001"}, {file = "ruamel.yaml.clib-0.2.8-cp39-cp39-macosx_12_0_arm64.whl", hash = "sha256:bba64af9fa9cebe325a62fa398760f5c7206b215201b0ec825005f1b18b9bccf"}, - {file = "ruamel.yaml.clib-0.2.8-cp39-cp39-manylinux_2_24_aarch64.whl", hash = "sha256:a1a45e0bb052edf6a1d3a93baef85319733a888363938e1fc9924cb00c8df24c"}, + {file = "ruamel.yaml.clib-0.2.8-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:9eb5dee2772b0f704ca2e45b1713e4e5198c18f515b52743576d196348f374d3"}, {file = "ruamel.yaml.clib-0.2.8-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:da09ad1c359a728e112d60116f626cc9f29730ff3e0e7db72b9a2dbc2e4beed5"}, {file = "ruamel.yaml.clib-0.2.8-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:184565012b60405d93838167f425713180b949e9d8dd0bbc7b49f074407c5a8b"}, {file = "ruamel.yaml.clib-0.2.8-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:a75879bacf2c987c003368cf14bed0ffe99e8e85acfa6c0bfffc21a090f16880"}, @@ -4727,29 +4727,29 @@ files = [ [[package]] name = "ruff" -version = "0.7.1" +version = "0.8.6" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.7.1-py3-none-linux_armv6l.whl", hash = "sha256:cb1bc5ed9403daa7da05475d615739cc0212e861b7306f314379d958592aaa89"}, - {file = "ruff-0.7.1-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:27c1c52a8d199a257ff1e5582d078eab7145129aa02721815ca8fa4f9612dc35"}, - {file = "ruff-0.7.1-py3-none-macosx_11_0_arm64.whl", hash = "sha256:588a34e1ef2ea55b4ddfec26bbe76bc866e92523d8c6cdec5e8aceefeff02d99"}, - {file = "ruff-0.7.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:94fc32f9cdf72dc75c451e5f072758b118ab8100727168a3df58502b43a599ca"}, - {file = "ruff-0.7.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:985818742b833bffa543a84d1cc11b5e6871de1b4e0ac3060a59a2bae3969250"}, - {file = "ruff-0.7.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:32f1e8a192e261366c702c5fb2ece9f68d26625f198a25c408861c16dc2dea9c"}, - {file = "ruff-0.7.1-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:699085bf05819588551b11751eff33e9ca58b1b86a6843e1b082a7de40da1565"}, - {file = "ruff-0.7.1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:344cc2b0814047dc8c3a8ff2cd1f3d808bb23c6658db830d25147339d9bf9ea7"}, - {file = "ruff-0.7.1-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4316bbf69d5a859cc937890c7ac7a6551252b6a01b1d2c97e8fc96e45a7c8b4a"}, - {file = "ruff-0.7.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:79d3af9dca4c56043e738a4d6dd1e9444b6d6c10598ac52d146e331eb155a8ad"}, - {file = "ruff-0.7.1-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:c5c121b46abde94a505175524e51891f829414e093cd8326d6e741ecfc0a9112"}, - {file = "ruff-0.7.1-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:8422104078324ea250886954e48f1373a8fe7de59283d747c3a7eca050b4e378"}, - {file = "ruff-0.7.1-py3-none-musllinux_1_2_i686.whl", hash = "sha256:56aad830af8a9db644e80098fe4984a948e2b6fc2e73891538f43bbe478461b8"}, - {file = "ruff-0.7.1-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:658304f02f68d3a83c998ad8bf91f9b4f53e93e5412b8f2388359d55869727fd"}, - {file = "ruff-0.7.1-py3-none-win32.whl", hash = "sha256:b517a2011333eb7ce2d402652ecaa0ac1a30c114fbbd55c6b8ee466a7f600ee9"}, - {file = "ruff-0.7.1-py3-none-win_amd64.whl", hash = "sha256:f38c41fcde1728736b4eb2b18850f6d1e3eedd9678c914dede554a70d5241307"}, - {file = "ruff-0.7.1-py3-none-win_arm64.whl", hash = "sha256:19aa200ec824c0f36d0c9114c8ec0087082021732979a359d6f3c390a6ff2a37"}, - {file = "ruff-0.7.1.tar.gz", hash = "sha256:9d8a41d4aa2dad1575adb98a82870cf5db5f76b2938cf2206c22c940034a36f4"}, + {file = "ruff-0.8.6-py3-none-linux_armv6l.whl", hash = "sha256:defed167955d42c68b407e8f2e6f56ba52520e790aba4ca707a9c88619e580e3"}, + {file = "ruff-0.8.6-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:54799ca3d67ae5e0b7a7ac234baa657a9c1784b48ec954a094da7c206e0365b1"}, + {file = "ruff-0.8.6-py3-none-macosx_11_0_arm64.whl", hash = "sha256:e88b8f6d901477c41559ba540beeb5a671e14cd29ebd5683903572f4b40a9807"}, + {file = "ruff-0.8.6-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0509e8da430228236a18a677fcdb0c1f102dd26d5520f71f79b094963322ed25"}, + {file = "ruff-0.8.6-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:91a7ddb221779871cf226100e677b5ea38c2d54e9e2c8ed847450ebbdf99b32d"}, + {file = "ruff-0.8.6-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:248b1fb3f739d01d528cc50b35ee9c4812aa58cc5935998e776bf8ed5b251e75"}, + {file = "ruff-0.8.6-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:bc3c083c50390cf69e7e1b5a5a7303898966be973664ec0c4a4acea82c1d4315"}, + {file = "ruff-0.8.6-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:52d587092ab8df308635762386f45f4638badb0866355b2b86760f6d3c076188"}, + {file = "ruff-0.8.6-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:61323159cf21bc3897674e5adb27cd9e7700bab6b84de40d7be28c3d46dc67cf"}, + {file = "ruff-0.8.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7ae4478b1471fc0c44ed52a6fb787e641a2ac58b1c1f91763bafbc2faddc5117"}, + {file = "ruff-0.8.6-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:0c000a471d519b3e6cfc9c6680025d923b4ca140ce3e4612d1a2ef58e11f11fe"}, + {file = "ruff-0.8.6-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:9257aa841e9e8d9b727423086f0fa9a86b6b420fbf4bf9e1465d1250ce8e4d8d"}, + {file = "ruff-0.8.6-py3-none-musllinux_1_2_i686.whl", hash = "sha256:45a56f61b24682f6f6709636949ae8cc82ae229d8d773b4c76c09ec83964a95a"}, + {file = "ruff-0.8.6-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:496dd38a53aa173481a7d8866bcd6451bd934d06976a2505028a50583e001b76"}, + {file = "ruff-0.8.6-py3-none-win32.whl", hash = "sha256:e169ea1b9eae61c99b257dc83b9ee6c76f89042752cb2d83486a7d6e48e8f764"}, + {file = "ruff-0.8.6-py3-none-win_amd64.whl", hash = "sha256:f1d70bef3d16fdc897ee290d7d20da3cbe4e26349f62e8a0274e7a3f4ce7a905"}, + {file = "ruff-0.8.6-py3-none-win_arm64.whl", hash = "sha256:7d7fc2377a04b6e04ffe588caad613d0c460eb2ecba4c0ccbbfe2bc973cbc162"}, + {file = "ruff-0.8.6.tar.gz", hash = "sha256:dcad24b81b62650b0eb8814f576fc65cfee8674772a6e24c9b747911801eeaa5"}, ] [[package]] @@ -5848,4 +5848,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = "^3.10, < 3.13" -content-hash = "4323d30cd07085e1eae87b59aa4f8be835e9a6b0bf771890376bebbc03a21c97" +content-hash = "84e302a4eb61e5f3444665244239455d6c6dc1b01509669ef5d362d7fb226ba7" diff --git a/pyproject.toml b/pyproject.toml index a925975768..fe3123ff88 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -87,7 +87,7 @@ pre-commit = "^2.20.0" types-toml = "*" types-ujson = "*" types-pyyaml = "*" -ruff = "0.7.1" +ruff = "0.8.6" invoke = "2.2.0" pytest-benchmark = "^4.0.0" pytest-codspeed = "^2.2.0" @@ -478,6 +478,8 @@ ignore = [ "FURB140", # Use `itertools.starmap` instead of the generator "FURB171", # Membership test against single-item container "FURB192", # Prefer `min` over `sorted()` to compute the minimum value in a sequence + "INP001", # File declares a package, but is nested under an implicit namespace package. + "LOG015", # `info()` call on root logger "N801", # Class name should use CapWords convention "N802", # Function name should be lowercase "N806", # Variable in function should be lowercase @@ -499,6 +501,8 @@ ignore = [ "PLR6201", # Use a `set` literal when testing for membership "PLR6301", # Method could be a function, class method, or static method "PLW0603", # Using the global statement to update `SETTINGS` is discouraged + "PLW1508", # Invalid type for environment variable default; expected `str` or `None` + "PYI061", # [*] `Literal[None]` can be replaced with `None` "RET503", # Missing explicit `return` at the end of function able to return non-`None` value "RET504", # Unnecessary assignment before `return` statement "RUF005", # Consider `[*list(peers.values()), rfc5735]` instead of concatenation @@ -508,6 +512,13 @@ ignore = [ "RUF015", # Prefer `next(...)` over single element slice "RUF021", # Parenthesize `a and b` expressions when chaining `and` and `or` together, to make the precedence clear "RUF029", # Function is declared `async`, but doesn't `await` or use `async` features. + "RUF036", # `None` not at the end of the type annotation. + "RUF039", # [*] First argument to `re.compile()` is not raw string + "RUF043", # Pattern passed to `match=` contains metacharacters but is neither escaped nor raw + "RUF051", # [*] Use `pop` instead of `key in dict` followed by `del dict[key]` + "RUF052", # Local dummy variable `_meta` is accessed + "RUF056", # [*] Avoid providing a falsy fallback to `dict.get()` in boolean test positions. The default fallback `None` is already falsy. + "RUF100", # [*] Unused `noqa` directive (non-enabled: `INP001`) "S101", # Use of `assert` detected "S105", # Possible hardcoded password assigned to: "REGEX_PASSWORD" "S108", # Probable insecure usage of temporary file or directory @@ -525,9 +536,12 @@ ignore = [ "SIM201", # Use `backup_path.suffix != ".backup"` instead of `not backup_path.suffix == ".backup"` "SIM401", # Use `property["items"].get("format", None)` instead of an `if` block "SIM910", # Use `data.get("identifier")` instead of `data.get("identifier", None)` + "TC006", # [*] Add quotes to type expression in `typing.cast()` + "UP006", # Use `dict` instead of `Dict` for type annotation "UP012", # Unnecessary call to encode as UTF-8 "UP018", # Unnecessary {literal_type} call (rewrite as a literal) "UP031", # Use format specifiers instead of percent format + "UP035", # `typing.List` is deprecated, use `list` instead ] #https://docs.astral.sh/ruff/formatter/black/