Skip to content

Commit b55cc1e

Browse files
authored
chore!: drop Python 3.8 support (#187)
drop Python 3.8 support Signed-off-by: gruebel <[email protected]>
1 parent 9db9ad6 commit b55cc1e

File tree

16 files changed

+39
-52
lines changed

16 files changed

+39
-52
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
runs-on: ubuntu-latest
2626
strategy:
2727
matrix:
28-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
28+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
2929
package:
3030
- "hooks/openfeature-hooks-opentelemetry"
3131
- "providers/openfeature-provider-flagd"
@@ -50,15 +50,15 @@ jobs:
5050
working-directory: ${{ matrix.package }}
5151

5252
- name: Type checking
53-
if: matrix.python-version == '3.11'
53+
if: matrix.python-version == '3.13'
5454
working-directory: ${{ matrix.package }}
5555
run: hatch run mypy:run
5656

5757
- name: Test with pytest
5858
run: hatch test -c
5959
working-directory: ${{ matrix.package }}
6060

61-
- if: matrix.python-version == '3.11'
61+
- if: matrix.python-version == '3.13'
6262
name: Upload coverage to Codecov
6363
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
6464
with:
@@ -75,7 +75,7 @@ jobs:
7575
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
7676
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5
7777
with:
78-
python-version: "3.11"
78+
python-version: "3.13"
7979
cache: "pip"
8080

8181
- name: Run pre-commit

.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

hooks/openfeature-hooks-opentelemetry/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ dependencies = [
2020
"openfeature-sdk>=0.6.0",
2121
"opentelemetry-api",
2222
]
23-
requires-python = ">=3.8"
23+
requires-python = ">=3.9"
2424

2525
[project.urls]
2626
Homepage = "https://github.com/open-feature/python-sdk-contrib"
@@ -70,7 +70,7 @@ packages = ["src/openfeature"]
7070
mypy_path = "src"
7171
files = "src"
7272

73-
python_version = "3.8" # should be identical to the minimum supported version
73+
python_version = "3.9" # should be identical to the minimum supported version
7474
namespace_packages = true
7575
explicit_package_bases = true
7676
local_partial_types = true

providers/openfeature-provider-flagd/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ dependencies = [
2626
"pyyaml>=6.0.1",
2727
"cachebox"
2828
]
29-
requires-python = ">=3.8"
29+
requires-python = ">=3.9"
3030

3131
[project.urls]
3232
Homepage = "https://github.com/open-feature/python-sdk-contrib"
@@ -113,7 +113,7 @@ omit = [
113113
mypy_path = "src"
114114
files = "src"
115115

116-
python_version = "3.8" # should be identical to the minimum supported version
116+
python_version = "3.9" # should be identical to the minimum supported version
117117
namespace_packages = true
118118
explicit_package_bases = true
119119
local_partial_types = true

providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/process/flags.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ def from_dict(cls, key: str, data: dict) -> "Flag":
7575
return flag
7676

7777
@property
78-
def default(self) -> typing.Tuple[str, typing.Any]:
78+
def default(self) -> tuple[str, typing.Any]:
7979
return self.get_variant(self.default_variant)
8080

8181
def get_variant(
8282
self, variant_key: typing.Union[str, bool]
83-
) -> typing.Tuple[str, typing.Any]:
83+
) -> tuple[str, typing.Any]:
8484
if isinstance(variant_key, bool):
8585
variant_key = str(variant_key).lower()
8686

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
# as soon as we support all the features, we can actually remove this limitation to not run on Python 3.8
2-
# Python 3.8 does not fully support tagging, hence that it will run all cases
3-
import sys
4-
51
from pytest_bdd import scenarios
62

73
from tests.e2e.paths import TEST_HARNESS_PATH
84

9-
if sys.version_info >= (3, 9):
10-
scenarios(f"{TEST_HARNESS_PATH}/gherkin")
5+
scenarios(f"{TEST_HARNESS_PATH}/gherkin")
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
import sys
2-
31
from pytest_bdd import scenarios
42

53
from tests.e2e.paths import TEST_HARNESS_PATH
64

7-
# as soon as we support all the features, we can actually remove this limitation to not run on Python 3.8
8-
# Python 3.8 does not fully support tagging, hence that it will run all cases
9-
if sys.version_info >= (3, 9):
10-
scenarios(f"{TEST_HARNESS_PATH}/gherkin")
5+
scenarios(f"{TEST_HARNESS_PATH}/gherkin")

providers/openfeature-provider-flagd/tests/e2e/step/flag_step.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import typing
2-
31
import requests
42
from asserts import assert_equal
53
from pytest_bdd import given, parsers, then, when
@@ -20,7 +18,7 @@
2018
)
2119
def setup_key_and_default(
2220
key: str, default: JsonPrimitive, type_info: str
23-
) -> typing.Tuple[str, JsonPrimitive, str]:
21+
) -> tuple[str, JsonPrimitive, str]:
2422
return key, default, type_info
2523

2624

providers/openfeature-provider-flagd/tests/e2e/step/provider_steps.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import logging
22
import os
33
import time
4-
import typing
54
from enum import Enum
65
from pathlib import Path
76

@@ -43,7 +42,7 @@ def setup_provider_old(
4342

4443
def get_default_options_for_provider(
4544
provider_type: str, resolver_type: ResolverType, container
46-
) -> typing.Tuple[dict, bool]:
45+
) -> tuple[dict, bool]:
4746
launchpad = "default"
4847
t = TestProviderType(provider_type)
4948
options: dict = {

providers/openfeature-provider-flagd/tests/test_targeting.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ class VersionPrefixed(Enum):
9898
@dataclass
9999
class SemVerTest:
100100
title: str
101-
rule: typing.List[str]
101+
rule: list[str]
102102
result: typing.Optional[bool]
103103

104104

105-
semver_operations: typing.List[SemVerTest] = [
105+
semver_operations: list[SemVerTest] = [
106106
# Successful and working rules
107107
SemVerTest("equals", ["1.2.3", "=", "1.2.3"], True),
108108
SemVerTest("not equals", ["1.2.3", "!=", "1.2.4"], True),

providers/openfeature-provider-flipt/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ dependencies = [
2020
"openfeature-sdk>=0.7.0",
2121
"openfeature-provider-ofrep>=0.1.0",
2222
]
23-
requires-python = ">=3.8"
23+
requires-python = ">=3.9"
2424

2525
[project.urls]
2626
Homepage = "https://github.com/open-feature/python-sdk-contrib"
@@ -75,7 +75,7 @@ omit = [
7575
mypy_path = "src"
7676
files = "src"
7777

78-
python_version = "3.8" # should be identical to the minimum supported version
78+
python_version = "3.9" # should be identical to the minimum supported version
7979
namespace_packages = true
8080
explicit_package_bases = true
8181
local_partial_types = true

providers/openfeature-provider-flipt/src/openfeature/contrib/provider/flipt/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Callable, Dict, Optional
1+
from typing import Callable, Optional
22

33
from openfeature.contrib.provider.ofrep import OFREPProvider
44
from openfeature.provider import Metadata
@@ -15,7 +15,7 @@ def __init__(
1515
base_url: str,
1616
namespace: str,
1717
*,
18-
headers_factory: Optional[Callable[[], Dict[str, str]]] = None,
18+
headers_factory: Optional[Callable[[], dict[str, str]]] = None,
1919
timeout: float = 5.0,
2020
):
2121
"""Override the OFREPProvider constructor to add a namespace parameter"""
@@ -25,8 +25,8 @@ def __init__(
2525
super().__init__(base_url, headers_factory=headers_factory, timeout=timeout)
2626

2727
def _resolve_header_factory(
28-
self, namespace: str, headers_factory: Optional[Callable[[], Dict[str, str]]]
29-
) -> Callable[[], Dict[str, str]]:
28+
self, namespace: str, headers_factory: Optional[Callable[[], dict[str, str]]]
29+
) -> Callable[[], dict[str, str]]:
3030
"""
3131
Resolves and returns a headers factory callable that includes the "X-Flipt-Namespace" header.
3232

providers/openfeature-provider-ofrep/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ dependencies = [
2020
"openfeature-sdk>=0.7.0",
2121
"requests>=2.27.0"
2222
]
23-
requires-python = ">=3.8"
23+
requires-python = ">=3.9"
2424

2525
[project.urls]
2626
Homepage = "https://github.com/open-feature/python-sdk-contrib"
@@ -75,7 +75,7 @@ omit = [
7575
mypy_path = "src"
7676
files = "src"
7777

78-
python_version = "3.8" # should be identical to the minimum supported version
78+
python_version = "3.9" # should be identical to the minimum supported version
7979
namespace_packages = true
8080
explicit_package_bases = true
8181
local_partial_types = true

providers/openfeature-provider-ofrep/src/openfeature/contrib/provider/ofrep/__init__.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import re
22
from datetime import datetime, timedelta, timezone
33
from email.utils import parsedate_to_datetime
4-
from typing import Any, Callable, Dict, List, NoReturn, Optional, Tuple, Type, Union
4+
from typing import Any, Callable, NoReturn, Optional, Union
55
from urllib.parse import urljoin
66

77
import requests
@@ -25,14 +25,14 @@
2525
__all__ = ["OFREPProvider"]
2626

2727

28-
TypeMap = Dict[
28+
TypeMap = dict[
2929
FlagType,
3030
Union[
31-
Type[bool],
32-
Type[int],
33-
Type[float],
34-
Type[str],
35-
Tuple[Type[dict], Type[list]],
31+
type[bool],
32+
type[int],
33+
type[float],
34+
type[str],
35+
tuple[type[dict], type[list]],
3636
],
3737
]
3838

@@ -42,7 +42,7 @@ def __init__(
4242
self,
4343
base_url: str,
4444
*,
45-
headers_factory: Optional[Callable[[], Dict[str, str]]] = None,
45+
headers_factory: Optional[Callable[[], dict[str, str]]] = None,
4646
timeout: float = 5.0,
4747
):
4848
self.base_url = base_url
@@ -54,7 +54,7 @@ def __init__(
5454
def get_metadata(self) -> Metadata:
5555
return Metadata(name="OpenFeature Remote Evaluation Protocol Provider")
5656

57-
def get_provider_hooks(self) -> List[Hook]:
57+
def get_provider_hooks(self) -> list[Hook]:
5858
return []
5959

6060
def resolve_boolean_details(
@@ -191,8 +191,8 @@ def _handle_error(self, exception: requests.RequestException) -> NoReturn:
191191

192192
def _build_request_data(
193193
evaluation_context: Optional[EvaluationContext],
194-
) -> Dict[str, Any]:
195-
data: Dict[str, Any] = {}
194+
) -> dict[str, Any]:
195+
data: dict[str, Any] = {}
196196
if evaluation_context:
197197
data["context"] = {}
198198
if evaluation_context.targeting_key:

ruff.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ exclude = [
55
"venv",
66
"providers/openfeature-provider-flagd/src/openfeature/schemas/**"
77
]
8-
target-version = "py38"
8+
target-version = "py39"
99

1010
[lint]
1111
select = [

0 commit comments

Comments
 (0)