diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9cb863d..f78ea06 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,12 +43,13 @@ jobs: - name: Run E2E tests with behave run: hatch run e2e - - name: Upload coverage to Codecov + - if: matrix.python-version == '3.11' + name: Upload coverage to Codecov uses: codecov/codecov-action@v3 with: flags: unittests # optional name: coverage # optional - fail_ci_if_error: true # optional (default = false) + fail_ci_if_error: false # optional (default = false) verbose: true # optional (default = false) lint: diff --git a/openfeature/api.py b/openfeature/api.py index cbff4b6..c04d423 100644 --- a/openfeature/api.py +++ b/openfeature/api.py @@ -13,6 +13,21 @@ from openfeature.provider import FeatureProvider from openfeature.provider._registry import provider_registry from openfeature.provider.metadata import Metadata +__all__ = [ + "get_client", + "set_provider", + "clear_providers", + "get_provider_metadata", + "get_evaluation_context", + "set_evaluation_context", + "add_hooks", + "clear_hooks", + "get_hooks", + "shutdown", + "add_handler", + "remove_handler", +] + _evaluation_context = EvaluationContext() _hooks: typing.List[Hook] = [] diff --git a/openfeature/client.py b/openfeature/client.py index c2203ca..0429911 100644 --- a/openfeature/client.py +++ b/openfeature/client.py @@ -30,6 +30,11 @@ from openfeature.hook._hook_support import ( from openfeature.provider import FeatureProvider, ProviderStatus from openfeature.provider._registry import provider_registry +__all__ = [ + "ClientMetadata", + "OpenFeatureClient", +] + logger = logging.getLogger("openfeature") GetDetailCallable = typing.Union[ diff --git a/openfeature/evaluation_context.py b/openfeature/evaluation_context.py index 829ada6..c3af350 100644 --- a/openfeature/evaluation_context.py +++ b/openfeature/evaluation_context.py @@ -1,6 +1,8 @@ import typing from dataclasses import dataclass, field +__all__ = ["EvaluationContext"] + @dataclass class EvaluationContext: diff --git a/openfeature/event.py b/openfeature/event.py index 367e585..5fd64d2 100644 --- a/openfeature/event.py +++ b/openfeature/event.py @@ -7,6 +7,8 @@ from typing import Callable, ClassVar, Dict, List, Optional, Union from openfeature.exception import ErrorCode from openfeature.provider import ProviderStatus +__all__ = ["ProviderEvent", "ProviderEventDetails", "EventDetails", "EventHandler"] + class ProviderEvent(Enum): PROVIDER_READY = "PROVIDER_READY" diff --git a/openfeature/exception.py b/openfeature/exception.py index d17c28f..3ae54a5 100644 --- a/openfeature/exception.py +++ b/openfeature/exception.py @@ -4,6 +4,19 @@ import typing from collections.abc import Mapping from enum import Enum +__all__ = [ + "OpenFeatureError", + "ProviderNotReadyError", + "ProviderFatalError", + "FlagNotFoundError", + "GeneralError", + "ParseError", + "TypeMismatchError", + "TargetingKeyMissingError", + "InvalidContextError", + "ErrorCode", +] + class OpenFeatureError(Exception): """ diff --git a/openfeature/flag_evaluation.py b/openfeature/flag_evaluation.py index 86233ed..db9cea1 100644 --- a/openfeature/flag_evaluation.py +++ b/openfeature/flag_evaluation.py @@ -11,6 +11,16 @@ if typing.TYPE_CHECKING: # pragma: no cover from openfeature.hook import Hook, HookHints +__all__ = [ + "FlagType", + "Reason", + "FlagMetadata", + "FlagEvaluationDetails", + "FlagEvaluationOptions", + "FlagResolutionDetails", +] + + class FlagType(StrEnum): BOOLEAN = "BOOLEAN" STRING = "STRING" diff --git a/openfeature/hook/__init__.py b/openfeature/hook/__init__.py index 8cb1c14..e1524ad 100644 --- a/openfeature/hook/__init__.py +++ b/openfeature/hook/__init__.py @@ -12,6 +12,8 @@ if TYPE_CHECKING: from openfeature.client import ClientMetadata from openfeature.provider.metadata import Metadata +__all__ = ["HookType", "HookContext", "HookHints", "Hook"] + class HookType(Enum): BEFORE = "before" diff --git a/openfeature/provider/__init__.py b/openfeature/provider/__init__.py index 30ed103..77111f2 100644 --- a/openfeature/provider/__init__.py +++ b/openfeature/provider/__init__.py @@ -7,6 +7,8 @@ from openfeature.hook import Hook from .metadata import Metadata +__all__ = ["ProviderStatus", "FeatureProvider", "Metadata"] + class ProviderStatus(Enum): NOT_READY = "NOT_READY" diff --git a/openfeature/provider/provider.py b/openfeature/provider/provider.py index debc1d5..9fc8594 100644 --- a/openfeature/provider/provider.py +++ b/openfeature/provider/provider.py @@ -8,6 +8,8 @@ from openfeature.hook import Hook from openfeature.provider import FeatureProvider from openfeature.provider.metadata import Metadata +__all__ = ["AbstractProvider"] + class AbstractProvider(FeatureProvider): def initialize(self, evaluation_context: EvaluationContext) -> None: