Skip to content

Commit de1a79e

Browse files
authored
Drop Python 3.8 (hynek#768)
1 parent 53051f1 commit de1a79e

File tree

17 files changed

+46
-40
lines changed

17 files changed

+46
-40
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ You can find our backwards-compatibility policy [here](https://github.com/hynek/
1515

1616
## [Unreleased](https://github.com/hynek/structlog/compare/25.5.0...HEAD)
1717

18+
### Removed
19+
20+
- Python 3.8 support.
21+
1822

1923
## [25.5.0](https://github.com/hynek/structlog/compare/25.4.0...25.5.0) - 2025-10-27
2024

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,13 @@ dynamic = ["readme", "version"]
1010
name = "structlog"
1111
description = "Structured Logging for Python"
1212
authors = [{ name = "Hynek Schlawack", email = "hs@ox.cx" }]
13-
requires-python = ">=3.8"
13+
requires-python = ">=3.9"
1414
license = "MIT OR Apache-2.0"
1515
keywords = ["logging", "structured", "structure", "log"]
1616
classifiers = [
1717
"Development Status :: 5 - Production/Stable",
1818
"License :: OSI Approved :: Apache Software License",
1919
"License :: OSI Approved :: MIT License",
20-
"Programming Language :: Python :: 3.8",
2120
"Programming Language :: Python :: 3.9",
2221
"Programming Language :: Python :: 3.10",
2322
"Programming Language :: Python :: 3.11",

src/structlog/_base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111

1212
import sys
1313

14-
from typing import Any, Iterable, Mapping, Sequence
14+
from collections.abc import Iterable, Mapping, Sequence
15+
from typing import Any
1516

1617
from structlog.exceptions import DropEvent
1718

src/structlog/_config.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
import sys
1414
import warnings
1515

16-
from typing import Any, Callable, Iterable, Sequence, Type, cast
16+
from collections.abc import Iterable, Sequence
17+
from typing import Any, Callable, cast
1718

1819
from ._native import make_filtering_bound_logger
1920
from ._output import PrintLoggerFactory
@@ -53,7 +54,7 @@
5354
force_colors=_force_colors,
5455
),
5556
]
56-
_BUILTIN_DEFAULT_CONTEXT_CLASS = cast(Type[Context], dict)
57+
_BUILTIN_DEFAULT_CONTEXT_CLASS = cast(type[Context], dict)
5758
_BUILTIN_DEFAULT_WRAPPER_CLASS = make_filtering_bound_logger(0)
5859
_BUILTIN_DEFAULT_LOGGER_FACTORY = PrintLoggerFactory()
5960
_BUILTIN_CACHE_LOGGER_ON_FIRST_USE = False

src/structlog/contextvars.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@
2222
import contextlib
2323
import contextvars
2424

25+
from collections.abc import Generator, Mapping
2526
from types import FrameType
26-
from typing import Any, Generator, Mapping
27+
from typing import Any
2728

2829
import structlog
2930

src/structlog/dev.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import sys
1515
import warnings
1616

17+
from collections.abc import Sequence
1718
from dataclasses import dataclass
1819
from io import StringIO
1920
from types import ModuleType
@@ -22,7 +23,6 @@
2223
Callable,
2324
Literal,
2425
Protocol,
25-
Sequence,
2626
TextIO,
2727
cast,
2828
)

src/structlog/processors.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,13 @@
1919
import threading
2020
import time
2121

22+
from collections.abc import Collection, Sequence
2223
from types import FrameType, TracebackType
2324
from typing import (
2425
Any,
2526
Callable,
2627
ClassVar,
27-
Collection,
2828
NamedTuple,
29-
Sequence,
3029
TextIO,
3130
cast,
3231
)

src/structlog/stdlib.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@
1818
import sys
1919
import warnings
2020

21+
from collections.abc import Collection, Iterable, Sequence
2122
from functools import partial
22-
from typing import Any, Callable, Collection, Dict, Iterable, Sequence, cast
23+
from typing import Any, Callable, cast
2324

2425

2526
if sys.version_info >= (3, 11):
@@ -1121,7 +1122,7 @@ def format(self, record: logging.LogRecord) -> str:
11211122
# We need to copy because it's possible that the same record gets
11221123
# processed by multiple logging formatters. LogRecord.getMessage
11231124
# would transform our dict into a str.
1124-
ed = cast(Dict[str, Any], record.msg).copy()
1125+
ed = cast(dict[str, Any], record.msg).copy()
11251126
ed["_record"] = record
11261127
ed["_from_structlog"] = True
11271128
else:

src/structlog/testing.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313

1414
from __future__ import annotations
1515

16+
from collections.abc import Generator, Iterable
1617
from contextlib import contextmanager
17-
from typing import Any, Generator, Iterable, NamedTuple, NoReturn
18+
from typing import Any, NamedTuple, NoReturn
1819

1920
from ._config import configure, get_config
2021
from ._log_levels import map_method_name

src/structlog/threadlocal.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
import uuid
2121
import warnings
2222

23-
from typing import Any, Generator, Iterator, TypeVar
23+
from collections.abc import Generator, Iterator
24+
from typing import Any, TypeVar
2425

2526
import structlog
2627

0 commit comments

Comments
 (0)