Skip to content

Commit bcd1a38

Browse files
gruebelbeeme1mr
andauthored
chore!: drop Python 3.8 support (#441)
* drop Python 3.8 support Signed-off-by: gruebel <[email protected]> * pin mypy python version to 3.9 Signed-off-by: gruebel <[email protected]> --------- Signed-off-by: gruebel <[email protected]> Co-authored-by: Michael Beemer <[email protected]>
1 parent d4f53b4 commit bcd1a38

16 files changed

+57
-52
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
runs-on: ubuntu-latest
2222
strategy:
2323
matrix:
24-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
24+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
2525

2626
steps:
2727
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
@@ -44,7 +44,7 @@ jobs:
4444
- name: Run E2E tests with behave
4545
run: hatch run e2e
4646

47-
- if: matrix.python-version == '3.11'
47+
- if: matrix.python-version == '3.13'
4848
name: Upload coverage to Codecov
4949
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
5050
with:
@@ -61,7 +61,7 @@ jobs:
6161
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
6262
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5
6363
with:
64-
python-version: "3.11"
64+
python-version: "3.13"
6565
cache: "pip"
6666

6767
- name: Run pre-commit
@@ -77,7 +77,7 @@ jobs:
7777
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
7878
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5
7979
with:
80-
python-version: "3.11"
80+
python-version: "3.13"
8181

8282
- name: Initialize CodeQL
8383
uses: github/codeql-action/init@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0 # v3

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
default_stages: [commit]
1+
default_stages: [pre-commit]
22
repos:
33
- repo: https://github.com/astral-sh/ruff-pre-commit
44
rev: v0.9.6

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
### System Requirements
66

7-
Python 3.8 and above are required.
7+
Python 3.9 and above are required.
88

99
### Target version(s)
1010

11-
Python 3.8 and above are supported by the SDK.
11+
Python 3.9 and above are supported by the SDK.
1212

1313
### Installation and Dependencies
1414

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
</a>
3535

3636
<a href="https://www.python.org/downloads/">
37-
<img alt="Min python version" src="https://img.shields.io/badge/python->=3.8-blue.svg" />
37+
<img alt="Min python version" src="https://img.shields.io/badge/python->=3.9-blue.svg" />
3838
</a>
3939

4040
<a href="https://www.repostatus.org/#wip">
@@ -51,7 +51,7 @@
5151

5252
### Requirements
5353

54-
- Python 3.8+
54+
- Python 3.9+
5555

5656
### Install
5757

openfeature/_event_support.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import threading
44
from collections import defaultdict
5-
from typing import TYPE_CHECKING, Dict, List
5+
from typing import TYPE_CHECKING
66

77
from openfeature.event import (
88
EventDetails,
@@ -17,10 +17,10 @@
1717

1818

1919
_global_lock = threading.RLock()
20-
_global_handlers: Dict[ProviderEvent, List[EventHandler]] = defaultdict(list)
20+
_global_handlers: dict[ProviderEvent, list[EventHandler]] = defaultdict(list)
2121

2222
_client_lock = threading.RLock()
23-
_client_handlers: Dict[OpenFeatureClient, Dict[ProviderEvent, List[EventHandler]]] = (
23+
_client_handlers: dict[OpenFeatureClient, dict[ProviderEvent, list[EventHandler]]] = (
2424
defaultdict(lambda: defaultdict(list))
2525
)
2626

openfeature/api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
NoOpTransactionContextPropagator()
4141
)
4242

43-
_hooks: typing.List[Hook] = []
43+
_hooks: list[Hook] = []
4444

4545

4646
def get_client(
@@ -96,7 +96,7 @@ def set_transaction_context(evaluation_context: EvaluationContext) -> None:
9696
)
9797

9898

99-
def add_hooks(hooks: typing.List[Hook]) -> None:
99+
def add_hooks(hooks: list[Hook]) -> None:
100100
global _hooks
101101
_hooks = _hooks + hooks
102102

@@ -106,7 +106,7 @@ def clear_hooks() -> None:
106106
_hooks = []
107107

108108

109-
def get_hooks() -> typing.List[Hook]:
109+
def get_hooks() -> list[Hook]:
110110
return _hooks
111111

112112

openfeature/client.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,14 @@
7777
typing.Awaitable[FlagResolutionDetails[typing.Union[dict, list]]],
7878
],
7979
]
80-
TypeMap = typing.Dict[
80+
TypeMap = dict[
8181
FlagType,
8282
typing.Union[
83-
typing.Type[bool],
84-
typing.Type[int],
85-
typing.Type[float],
86-
typing.Type[str],
87-
typing.Tuple[typing.Type[dict], typing.Type[list]],
83+
type[bool],
84+
type[int],
85+
type[float],
86+
type[str],
87+
tuple[type[dict], type[list]],
8888
],
8989
]
9090

@@ -101,7 +101,7 @@ def __init__(
101101
domain: typing.Optional[str],
102102
version: typing.Optional[str],
103103
context: typing.Optional[EvaluationContext] = None,
104-
hooks: typing.Optional[typing.List[Hook]] = None,
104+
hooks: typing.Optional[list[Hook]] = None,
105105
) -> None:
106106
self.domain = domain
107107
self.version = version
@@ -118,7 +118,7 @@ def get_provider_status(self) -> ProviderStatus:
118118
def get_metadata(self) -> ClientMetadata:
119119
return ClientMetadata(domain=self.domain)
120120

121-
def add_hooks(self, hooks: typing.List[Hook]) -> None:
121+
def add_hooks(self, hooks: list[Hook]) -> None:
122122
self.hooks = self.hooks + hooks
123123

124124
def get_boolean_value(
@@ -423,12 +423,12 @@ def _establish_hooks_and_provider(
423423
default_value: typing.Any,
424424
evaluation_context: typing.Optional[EvaluationContext],
425425
flag_evaluation_options: typing.Optional[FlagEvaluationOptions],
426-
) -> typing.Tuple[
426+
) -> tuple[
427427
FeatureProvider,
428428
HookContext,
429429
HookHints,
430-
typing.List[Hook],
431-
typing.List[Hook],
430+
list[Hook],
431+
list[Hook],
432432
]:
433433
if evaluation_context is None:
434434
evaluation_context = EvaluationContext()
@@ -477,7 +477,7 @@ def _before_hooks_and_merge_context(
477477
self,
478478
flag_type: FlagType,
479479
hook_context: HookContext,
480-
merged_hooks: typing.List[Hook],
480+
merged_hooks: list[Hook],
481481
hook_hints: HookHints,
482482
evaluation_context: typing.Optional[EvaluationContext],
483483
) -> EvaluationContext:

openfeature/event.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from dataclasses import dataclass, field
44
from enum import Enum
5-
from typing import Callable, Dict, List, Optional, Union
5+
from typing import Callable, Optional, Union
66

77
from openfeature.exception import ErrorCode
88

@@ -18,19 +18,19 @@ class ProviderEvent(Enum):
1818

1919
@dataclass
2020
class ProviderEventDetails:
21-
flags_changed: Optional[List[str]] = None
21+
flags_changed: Optional[list[str]] = None
2222
message: Optional[str] = None
2323
error_code: Optional[ErrorCode] = None
24-
metadata: Dict[str, Union[bool, str, int, float]] = field(default_factory=dict)
24+
metadata: dict[str, Union[bool, str, int, float]] = field(default_factory=dict)
2525

2626

2727
@dataclass
2828
class EventDetails(ProviderEventDetails):
2929
provider_name: str = ""
30-
flags_changed: Optional[List[str]] = None
30+
flags_changed: Optional[list[str]] = None
3131
message: Optional[str] = None
3232
error_code: Optional[ErrorCode] = None
33-
metadata: Dict[str, Union[bool, str, int, float]] = field(default_factory=dict)
33+
metadata: dict[str, Union[bool, str, int, float]] = field(default_factory=dict)
3434

3535
@classmethod
3636
def from_provider_event_details(

openfeature/flag_evaluation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class FlagEvaluationDetails(typing.Generic[T_co]):
5858

5959
@dataclass
6060
class FlagEvaluationOptions:
61-
hooks: typing.List[Hook] = field(default_factory=list)
61+
hooks: list[Hook] = field(default_factory=list)
6262
hook_hints: HookHints = field(default_factory=dict)
6363

6464

openfeature/hook/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ def __setattr__(self, key: str, value: typing.Any) -> None:
6060
float,
6161
str,
6262
datetime,
63-
typing.List[typing.Any],
64-
typing.Dict[str, typing.Any],
63+
list[typing.Any],
64+
dict[str, typing.Any],
6565
],
6666
]
6767

0 commit comments

Comments
 (0)