From 997205262f99d8e900b64d18470dbd0752556f55 Mon Sep 17 00:00:00 2001 From: gruebel Date: Mon, 18 Mar 2024 20:12:46 +0100 Subject: [PATCH] update mypy and ruff Signed-off-by: gruebel --- .pre-commit-config.yaml | 4 ++-- openfeature/provider/__init__.py | 27 +++++++++------------------ pyproject.toml | 1 + 3 files changed, 12 insertions(+), 20 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6a79aaea..7e7e8a3a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ default_stages: [commit] repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.2.1 + rev: v0.3.3 hooks: - id: ruff args: [--fix] @@ -16,7 +16,7 @@ repos: - id: check-merge-conflict - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.8.0 + rev: v1.9.0 hooks: - id: mypy files: openfeature diff --git a/openfeature/provider/__init__.py b/openfeature/provider/__init__.py index edb94ae1..30ed103f 100644 --- a/openfeature/provider/__init__.py +++ b/openfeature/provider/__init__.py @@ -17,54 +17,45 @@ class ProviderStatus(Enum): class FeatureProvider(typing.Protocol): # pragma: no cover - def initialize(self, evaluation_context: EvaluationContext) -> None: - ... + def initialize(self, evaluation_context: EvaluationContext) -> None: ... - def shutdown(self) -> None: - ... + def shutdown(self) -> None: ... - def get_metadata(self) -> Metadata: - ... + def get_metadata(self) -> Metadata: ... - def get_provider_hooks(self) -> typing.List[Hook]: - ... + def get_provider_hooks(self) -> typing.List[Hook]: ... def resolve_boolean_details( self, flag_key: str, default_value: bool, evaluation_context: typing.Optional[EvaluationContext] = None, - ) -> FlagResolutionDetails[bool]: - ... + ) -> FlagResolutionDetails[bool]: ... def resolve_string_details( self, flag_key: str, default_value: str, evaluation_context: typing.Optional[EvaluationContext] = None, - ) -> FlagResolutionDetails[str]: - ... + ) -> FlagResolutionDetails[str]: ... def resolve_integer_details( self, flag_key: str, default_value: int, evaluation_context: typing.Optional[EvaluationContext] = None, - ) -> FlagResolutionDetails[int]: - ... + ) -> FlagResolutionDetails[int]: ... def resolve_float_details( self, flag_key: str, default_value: float, evaluation_context: typing.Optional[EvaluationContext] = None, - ) -> FlagResolutionDetails[float]: - ... + ) -> FlagResolutionDetails[float]: ... def resolve_object_details( self, flag_key: str, default_value: typing.Union[dict, list], evaluation_context: typing.Optional[EvaluationContext] = None, - ) -> FlagResolutionDetails[typing.Union[dict, list]]: - ... + ) -> FlagResolutionDetails[typing.Union[dict, list]]: ... diff --git a/pyproject.toml b/pyproject.toml index b07d7535..da96ea8f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,6 +29,7 @@ Homepage = "https://github.com/open-feature/python-sdk" files = "openfeature" namespace_packages = true explicit_package_bases = true +local_partial_types = true # will become the new default from version 2 pretty = true strict = true disallow_any_generics = false