Skip to content

Commit be308d2

Browse files
Prepare for v1.1.9
1 parent b2096b9 commit be308d2

File tree

10 files changed

+29
-25
lines changed

10 files changed

+29
-25
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
runs-on: ubuntu-latest
1919
strategy:
2020
matrix:
21-
python-version: [3.9, "3.10", 3.11, 3.12, 3.13]
21+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
2222

2323
steps:
2424
- uses: actions/checkout@v4
@@ -49,7 +49,7 @@ jobs:
4949
5050
- name: Check type hints
5151
run: mypy .
52-
if: matrix.python-version == 3.12
52+
if: matrix.python-version == 3.13
5353

5454
- name: Upload pytest test results
5555
uses: actions/upload-artifact@master
@@ -64,18 +64,18 @@ jobs:
6464
6565
- name: Install distribution dependencies
6666
run: pip install build
67-
if: matrix.python-version == 3.12
67+
if: matrix.python-version == 3.13
6868

6969
- name: Create distribution package
7070
run: python -m build
71-
if: matrix.python-version == 3.12
71+
if: matrix.python-version == 3.13
7272

7373
- name: Upload distribution package
7474
uses: actions/upload-artifact@master
7575
with:
7676
name: dist
7777
path: dist
78-
if: matrix.python-version == 3.12
78+
if: matrix.python-version == 3.13
7979

8080
publish:
8181
runs-on: ubuntu-latest
@@ -88,10 +88,10 @@ jobs:
8888
name: dist
8989
path: dist
9090

91-
- name: Use Python 3.12
91+
- name: Use Python 3.13
9292
uses: actions/setup-python@v1
9393
with:
94-
python-version: '3.12'
94+
python-version: '3.13'
9595

9696
- name: Install dependencies
9797
run: |

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.1.9] - 2025-11-23
9+
10+
- Remove support for Python 3.9 and add Python 3.14 to the build matrix.
11+
- Update type annotations to Python >= 3.10.
12+
813
## [1.1.8] - 2025-10-03 :notes:
914

1015
- Improve the `Secret` class to always encode strings before comparing to `str`.

essentials/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.1.8"
1+
__version__ = "1.1.9"

essentials/caching.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import functools
22
import time
33
from collections import OrderedDict
4-
from typing import TYPE_CHECKING, Any, Generic, Iterable, Iterator, Tuple, TypeVar
4+
from typing import TYPE_CHECKING, Any, Generic, Iterable, Iterator, TypeVar
55

66
if TYPE_CHECKING:
77
from typing import Callable, TypeVarTuple, Unpack
@@ -81,7 +81,7 @@ def __delitem__(self, key) -> None:
8181
def __contains__(self, key) -> bool:
8282
return key in self._bag
8383

84-
def __iter__(self) -> Iterator[Tuple[Any, T]]:
84+
def __iter__(self) -> Iterator[tuple[Any, T]]:
8585
return iter(self._bag.items())
8686

8787
def clear(self) -> None:
@@ -173,7 +173,7 @@ def __contains__(self, key) -> bool:
173173
return False
174174
return True
175175

176-
def __iter__(self) -> Iterator[Tuple[Any, T]]:
176+
def __iter__(self) -> Iterator[tuple[Any, T]]:
177177
"""Iterates through cached items, discarding and removing expired ones."""
178178
for key, item in list(self._bag.items()):
179179
if self.expired(item):

essentials/decorators/logs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from functools import wraps
33
from inspect import iscoroutinefunction
44
from logging import Logger
5-
from typing import Callable, Optional, TypeVar
5+
from typing import Callable, TypeVar
66
from uuid import uuid4
77

88
from essentials.diagnostics import StopWatch
@@ -17,8 +17,8 @@ def _default_id_factory() -> str:
1717

1818

1919
def log(
20-
logger: Optional[Logger] = None,
21-
id_factory: Optional[IdFactory] = None,
20+
logger: Logger | None = None,
21+
id_factory: IdFactory | None = None,
2222
log_arguments: bool = False,
2323
log_return_value: bool = False,
2424
level=logging.INFO,

essentials/decorators/retry.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
import time
33
from functools import wraps
44
from inspect import iscoroutinefunction
5-
from typing import Callable, Optional, Tuple, Type, TypeVar, Union
5+
from typing import Callable, Type, TypeVar
66

77
T = TypeVar("T")
88
FuncType = Callable[..., T]
9-
CatchException = Union[Tuple[Type[Exception]], Type[Exception], None]
10-
OnException = Optional[Callable[[Type[Exception], int], None]]
9+
CatchException = tuple[Type[Exception]] | Type[Exception] | None
10+
OnException = Callable[[Type[Exception], int], None] | None
1111

1212

1313
def _get_retry_async_wrapper(
@@ -44,7 +44,7 @@ async def async_wrapper(*args, **kwargs):
4444

4545
def retry(
4646
times: int = 3,
47-
delay: Optional[float] = 0.1,
47+
delay: float | None = 0.1,
4848
catch_exceptions_types: CatchException = None,
4949
on_exception: OnException = None,
5050
loop=None,

essentials/folders.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import ntpath
22
import os
3-
from typing import Tuple
43

54

65
def ensure_folder(path) -> None:
76
os.makedirs(path, exist_ok=True)
87

98

10-
def split_path(filepath) -> Tuple[str, str, str]:
9+
def split_path(filepath) -> tuple[str, str, str]:
1110
"""Splits a file path into folder path, file name and extension"""
1211
head, tail = ntpath.split(filepath)
1312
filename, extension = os.path.splitext(tail)

essentials/meta.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import warnings
22
from functools import wraps
33
from inspect import iscoroutinefunction
4-
from typing import Callable, Optional, TypeVar
4+
from typing import Callable, TypeVar
55

66
T = TypeVar("T")
77
FuncType = Callable[..., T]
@@ -13,7 +13,7 @@ def __init__(self, param_name: str) -> None:
1313

1414

1515
def deprecated(
16-
message: Optional[str] = None, raise_exception=False
16+
message: str | None = None, raise_exception=False
1717
) -> Callable[[FuncType], FuncType]:
1818
"""
1919
This is a decorator which can be used to mark functions

essentials/registry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import reprlib
22
from abc import ABC
3-
from typing import List, Sequence, Type
3+
from typing import Sequence, Type
44

55
from essentials.exceptions import InvalidArgument
66

@@ -83,7 +83,7 @@ def get_class_name(cls) -> str:
8383
return s[:length] if s[length:] == key else s
8484

8585
@classmethod
86-
def get_subclasses(cls, base_class=None) -> List[Type["Registry"]]:
86+
def get_subclasses(cls, base_class=None) -> list[Type["Registry"]]:
8787
if base_class is None:
8888
base_class = cls.get_class()
8989

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ classifiers = [
1414
"Development Status :: 5 - Production/Stable",
1515
"License :: OSI Approved :: MIT License",
1616
"Programming Language :: Python :: 3",
17-
"Programming Language :: Python :: 3.9",
1817
"Programming Language :: Python :: 3.10",
1918
"Programming Language :: Python :: 3.11",
2019
"Programming Language :: Python :: 3.12",
2120
"Programming Language :: Python :: 3.13",
21+
"Programming Language :: Python :: 3.14",
2222
"Operating System :: OS Independent",
2323
]
2424
urls = { homepage = "https://github.com/Neoteroi/essentials" }

0 commit comments

Comments
 (0)