Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump inmanta-dev-dependencies[async,core,pytest] from 2.143.0 to 2.144.0 #8539

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelogs/unreleased/8539-dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
change-type: patch
description: Bump inmanta-dev-dependencies[async,core,pytest] from 2.143.0 to 2.144.0
destination-branches:
- iso7
sections: {}
9 changes: 4 additions & 5 deletions mypy-baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ src/inmanta/agent/io/local.py:0: error: Incompatible return value type (got "dic
src/inmanta/agent/io/local.py:0: note: "Dict" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance
src/inmanta/agent/io/local.py:0: note: Consider using "Mapping" instead, which is covariant in the value type
src/inmanta/agent/io/local.py:0: note: Perhaps you need a type annotation for "status"? Suggestion: "dict[str, int | str]"
src/inmanta/agent/io/local.py:0: error: Argument 1 to "write" of "BufferedWriter" has incompatible type "str"; expected "Buffer" [arg-type]
src/inmanta/agent/io/local.py:0: error: Argument 1 to "write" of "_BufferedIOBase" has incompatible type "str"; expected "Buffer" [arg-type]
src/inmanta/agent/io/local.py:0: error: Incompatible types in assignment (expression has type "int", variable has type "str | None") [assignment]
src/inmanta/agent/io/local.py:0: error: Incompatible types in assignment (expression has type "int | None", variable has type "str | None") [assignment]
src/inmanta/agent/io/local.py:0: error: Incompatible types in assignment (expression has type "int", variable has type "str | None") [assignment]
Expand Down Expand Up @@ -446,7 +446,7 @@ src/inmanta/protocol/endpoints.py:0: error: Value of type "BaseModel | UUID | in
src/inmanta/protocol/endpoints.py:0: error: No overload variant of "__getitem__" of "Sequence" matches argument type "str" [call-overload]
src/inmanta/protocol/endpoints.py:0: note: Possible overload variants:
src/inmanta/protocol/endpoints.py:0: note: def __getitem__(self, int, /) -> BaseModel | UUID | bool | int | float | datetime | str
src/inmanta/protocol/endpoints.py:0: note: def __getitem__(self, slice, /) -> Sequence[BaseModel | UUID | bool | int | float | datetime | str]
src/inmanta/protocol/endpoints.py:0: note: def __getitem__(self, slice[Any, Any, Any], /) -> Sequence[BaseModel | UUID | bool | int | float | datetime | str]
src/inmanta/protocol/endpoints.py:0: error: Incompatible types in assignment (expression has type "Any | BaseModel | UUID | int | float | datetime | str", variable has type "str") [assignment]
src/inmanta/protocol/endpoints.py:0: error: Incompatible types in assignment (expression has type "None", variable has type "RESTClient") [assignment]
src/inmanta/protocol/endpoints.py:0: error: Function is missing a return type annotation [no-untyped-def]
Expand Down Expand Up @@ -665,7 +665,7 @@ src/inmanta/data/__init__.py:0: note: def [_T] __init__(self, Iterable[_T], /) -
src/inmanta/data/__init__.py:0: error: "object" has no attribute "__iter__"; maybe "__dir__" or "__str__"? (not iterable) [attr-defined]
src/inmanta/data/__init__.py:0: error: Argument 1 to "__init__" of "BaseDocument" has incompatible type "**dict[str, object]"; expected "bool" [arg-type]
src/inmanta/data/__init__.py:0: error: Need type annotation for "_status" (hint: "_status: dict[<type>, <type>] = ...") [var-annotated]
src/inmanta/data/__init__.py:0: error: Invalid index type "str" for "str"; expected type "SupportsIndex | slice" [index]
src/inmanta/data/__init__.py:0: error: Invalid index type "str" for "str"; expected type "SupportsIndex | slice[Any, Any, Any]" [index]
src/inmanta/data/__init__.py:0: error: Signature of "get_list" incompatible with supertype "BaseDocument" [override]
src/inmanta/data/__init__.py:0: note: Superclass:
src/inmanta/data/__init__.py:0: note: @classmethod
Expand Down Expand Up @@ -864,7 +864,7 @@ src/inmanta/ast/constraint/expression.py:0: error: Function is missing a type an
src/inmanta/ast/constraint/expression.py:0: error: Function is missing a type annotation [no-untyped-def]
src/inmanta/agent/handler.py:0: error: Argument 3 to "log" of "LogLine" has incompatible type "**dict[str, object]"; expected "datetime | None" [arg-type]
src/inmanta/agent/handler.py:0: error: Returning Any from function declared to return "bool" [no-any-return]
src/inmanta/agent/handler.py:0: error: Argument 2 to "chain_future" has incompatible type "concurrent.futures._base.Future[T]"; expected "asyncio.futures.Future[Any]" [arg-type]
src/inmanta/agent/handler.py:0: error: Argument 2 to "chain_future" has incompatible type "concurrent.futures._base.Future[T]"; expected "_asyncio.Future[Any]" [arg-type]
src/inmanta/server/extensions.py:0: error: Returning Any from function declared to return "bool" [no-any-return]
src/inmanta/parser/plyInmantaLex.py:0: error: Item "LocatableString" of "str | LocatableString" has no attribute "index" [union-attr]
src/inmanta/parser/plyInmantaLex.py:0: error: Value of type "str | LocatableString" is not indexable [index]
Expand Down Expand Up @@ -1096,7 +1096,6 @@ src/inmanta/model.py:0: error: Call to untyped function "ReferenceValue" in type
src/inmanta/model.py:0: error: "Value" has no attribute "to_dict" [attr-defined]
src/inmanta/model.py:0: error: "Value" has no attribute "to_dict" [attr-defined]
src/inmanta/main.py:0: error: Returning Any from function declared to return "dict[str, Any] | None" [no-any-return]
src/inmanta/main.py:0: error: Invalid index type "str" for "str"; expected type "SupportsIndex | slice" [index]
src/inmanta/main.py:0: error: Value of type "dict[str, Any] | None" is not indexable [index]
src/inmanta/main.py:0: error: Need type annotation for "bar" [var-annotated]
src/inmanta/data/dataview.py:0: error: Argument "resource_id" to "LatestReleasedResource" has incompatible type "object"; expected "ResourceIdStr" [arg-type]
Expand Down
2 changes: 1 addition & 1 deletion requirements.dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
inmanta-dev-dependencies[pytest,async,core]==2.143.0
inmanta-dev-dependencies[pytest,async,core]==2.144.0
bumpversion==0.6.0
openapi_spec_validator==0.7.1
pip2pi==0.8.2
Expand Down
16 changes: 8 additions & 8 deletions src/inmanta/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ class TableLockMode(enum.Enum):
may be extended when a new lock mode is required.
"""

ROW_EXCLUSIVE: str = "ROW EXCLUSIVE"
SHARE_UPDATE_EXCLUSIVE: str = "SHARE UPDATE EXCLUSIVE"
SHARE: str = "SHARE"
SHARE_ROW_EXCLUSIVE: str = "SHARE ROW EXCLUSIVE"
ROW_EXCLUSIVE = "ROW EXCLUSIVE"
SHARE_UPDATE_EXCLUSIVE = "SHARE UPDATE EXCLUSIVE"
SHARE = "SHARE"
SHARE_ROW_EXCLUSIVE = "SHARE ROW EXCLUSIVE"


class RowLockMode(enum.Enum):
Expand All @@ -140,10 +140,10 @@ class RowLockMode(enum.Enum):
https://www.postgresql.org/docs/13/applevel-consistency.html#NON-SERIALIZABLE-CONSISTENCY.
"""

FOR_UPDATE: str = "FOR UPDATE"
FOR_NO_KEY_UPDATE: str = "FOR NO KEY UPDATE"
FOR_SHARE: str = "FOR SHARE"
FOR_KEY_SHARE: str = "FOR KEY SHARE"
FOR_UPDATE = "FOR UPDATE"
FOR_NO_KEY_UPDATE = "FOR NO KEY UPDATE"
FOR_SHARE = "FOR SHARE"
FOR_KEY_SHARE = "FOR KEY SHARE"


class RangeOperator(enum.Enum):
Expand Down
5 changes: 3 additions & 2 deletions src/inmanta/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ def version_report(client: Client, environment: str, version: str, show_detailed
if not result:
return

agents: dict[str, dict[str, list[str]]] = defaultdict(lambda: defaultdict(list))
agents: dict[str, dict[str, list[dict[str, object]]]] = defaultdict(lambda: defaultdict(list))
for res in result["resources"]:
if len(res["actions"]) > 0 or show_detailed_report:
agents[res["agent"]][res["resource_type"]].append(res)
Expand All @@ -750,7 +750,8 @@ def version_report(client: Client, environment: str, version: str, show_detailed
click.echo("=" * 72)

for t in sorted(agents[agent].keys()):
parsed_resource_version_id = Id.parse_id(ResourceVersionIdStr(agents[agent][t][0]["resource_version_id"]))
resource_version_id = cast(ResourceVersionIdStr, agents[agent][t][0]["resource_version_id"])
parsed_resource_version_id = Id.parse_id(resource_version_id)
click.echo(click.style("Resource type:", bold=True) + f"{t} ({parsed_resource_version_id.attribute})")
click.echo("-" * 72)

Expand Down
4 changes: 2 additions & 2 deletions src/inmanta/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -2762,8 +2762,8 @@ class ModuleGeneration(Enum):
The generation of a module. This might affect the on-disk structure of a module as well as how it's distributed.
"""

V1: int = 1
V2: int = 2
V1 = 1
V2 = 2


@stable_api
Expand Down
8 changes: 4 additions & 4 deletions src/inmanta/moduletool.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,10 @@ def determine_new_version(
@total_ordering
@enum.unique
class ChangeType(enum.Enum):
MAJOR: str = "major"
MINOR: str = "minor"
PATCH: str = "patch"
REVISION: str = "revision"
MAJOR = "major"
MINOR = "minor"
PATCH = "patch"
REVISION = "revision"

def __lt__(self, other: "ChangeType") -> bool:
order: list[ChangeType] = [ChangeType.REVISION, ChangeType.PATCH, ChangeType.MINOR, ChangeType.MAJOR]
Expand Down
7 changes: 5 additions & 2 deletions src/inmanta/protocol/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ def validate_generic(self) -> None:
if "jwt-username-claim" in self._config:
if self.sign:
raise ValueError(f"auth config {self.section} used for signing cannot use a custom claim.")
self.jwt_username_claim = self._config.get("jwt-username-claim")
self.jwt_username_claim = self._config["jwt-username-claim"]

def parse_claim_matching(self, claim_conf: str) -> None:
"""Parse claim matching expressions"""
Expand Down Expand Up @@ -431,7 +431,10 @@ def validate_rs265(self) -> None:
self.jwks_uri = self._config["jwks_uri"]

if "validate_cert" in self._config:
self.validate_cert = self._config.getboolean("validate_cert")
validate_cert = self._config.getboolean("validate_cert")
# Make mypy happy
assert validate_cert is not None
self.validate_cert = validate_cert
else:
self.validate_cert = True

Expand Down
8 changes: 4 additions & 4 deletions src/inmanta/warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import warnings
from collections.abc import Mapping
from enum import Enum
from typing import Literal, Optional, TextIO, Union
from typing import Optional, TextIO, Union


class InmantaWarning(Warning):
Expand All @@ -37,9 +37,9 @@ def __init__(self, *args: object):


class WarningBehaviour(Enum):
WARN: Literal["default"] = "default"
IGNORE: Literal["ignore"] = "ignore"
ERROR: Literal["error"] = "error"
WARN = "default"
IGNORE = "ignore"
ERROR = "error"


class WarningRule:
Expand Down
12 changes: 6 additions & 6 deletions stubs/asyncpg/transaction.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
# NOTE: This dynamically typed stub was automatically generated by stubgen.

import enum
from typing import Any, Optional, Type
from typing import Any, Optional, Type, cast
from types import TracebackType


class TransactionState(enum.Enum):
NEW: int = ...
STARTED: int = ...
COMMITTED: int = ...
ROLLEDBACK: int = ...
FAILED: int = ...
NEW = cast(int, ...)
STARTED = cast(int, ...)
COMMITTED = cast(int, ...)
ROLLEDBACK = cast(int, ...)
FAILED = cast(int, ...)

ISOLATION_LEVELS: Any

Expand Down