Skip to content

Commit 6e4eebc

Browse files
authored
chore: update mypy and ruff (#296)
update mypy and ruff Signed-off-by: gruebel <[email protected]>
1 parent f5987ef commit 6e4eebc

File tree

3 files changed

+12
-20
lines changed

3 files changed

+12
-20
lines changed

.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
default_stages: [commit]
22
repos:
33
- repo: https://github.com/astral-sh/ruff-pre-commit
4-
rev: v0.2.1
4+
rev: v0.3.3
55
hooks:
66
- id: ruff
77
args: [--fix]
@@ -16,7 +16,7 @@ repos:
1616
- id: check-merge-conflict
1717

1818
- repo: https://github.com/pre-commit/mirrors-mypy
19-
rev: v1.8.0
19+
rev: v1.9.0
2020
hooks:
2121
- id: mypy
2222
files: openfeature

openfeature/provider/__init__.py

+9-18
Original file line numberDiff line numberDiff line change
@@ -17,54 +17,45 @@ class ProviderStatus(Enum):
1717

1818

1919
class FeatureProvider(typing.Protocol): # pragma: no cover
20-
def initialize(self, evaluation_context: EvaluationContext) -> None:
21-
...
20+
def initialize(self, evaluation_context: EvaluationContext) -> None: ...
2221

23-
def shutdown(self) -> None:
24-
...
22+
def shutdown(self) -> None: ...
2523

26-
def get_metadata(self) -> Metadata:
27-
...
24+
def get_metadata(self) -> Metadata: ...
2825

29-
def get_provider_hooks(self) -> typing.List[Hook]:
30-
...
26+
def get_provider_hooks(self) -> typing.List[Hook]: ...
3127

3228
def resolve_boolean_details(
3329
self,
3430
flag_key: str,
3531
default_value: bool,
3632
evaluation_context: typing.Optional[EvaluationContext] = None,
37-
) -> FlagResolutionDetails[bool]:
38-
...
33+
) -> FlagResolutionDetails[bool]: ...
3934

4035
def resolve_string_details(
4136
self,
4237
flag_key: str,
4338
default_value: str,
4439
evaluation_context: typing.Optional[EvaluationContext] = None,
45-
) -> FlagResolutionDetails[str]:
46-
...
40+
) -> FlagResolutionDetails[str]: ...
4741

4842
def resolve_integer_details(
4943
self,
5044
flag_key: str,
5145
default_value: int,
5246
evaluation_context: typing.Optional[EvaluationContext] = None,
53-
) -> FlagResolutionDetails[int]:
54-
...
47+
) -> FlagResolutionDetails[int]: ...
5548

5649
def resolve_float_details(
5750
self,
5851
flag_key: str,
5952
default_value: float,
6053
evaluation_context: typing.Optional[EvaluationContext] = None,
61-
) -> FlagResolutionDetails[float]:
62-
...
54+
) -> FlagResolutionDetails[float]: ...
6355

6456
def resolve_object_details(
6557
self,
6658
flag_key: str,
6759
default_value: typing.Union[dict, list],
6860
evaluation_context: typing.Optional[EvaluationContext] = None,
69-
) -> FlagResolutionDetails[typing.Union[dict, list]]:
70-
...
61+
) -> FlagResolutionDetails[typing.Union[dict, list]]: ...

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Homepage = "https://github.com/open-feature/python-sdk"
2929
files = "openfeature"
3030
namespace_packages = true
3131
explicit_package_bases = true
32+
local_partial_types = true # will become the new default from version 2
3233
pretty = true
3334
strict = true
3435
disallow_any_generics = false

0 commit comments

Comments
 (0)