From 748c8620a364b13f20d314fed001d80349b4798f Mon Sep 17 00:00:00 2001 From: Willi Sontopski <32729196+LostInDarkMath@users.noreply.github.com> Date: Sun, 7 Dec 2025 14:19:19 +0100 Subject: [PATCH 1/2] removed workaround for Python version `3.14.0` in `@in_subprocess` decorator --- CHANGELOG.md | 4 ++++ pedantic/decorators/fn_deco_in_subprocess.py | 9 +-------- pyproject.toml | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 267769a..ee20e34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ # Changelog +## Pedantic 2.3.2 +- removed workaround for Python version `3.14.0` in `@in_subprocess` decorator + - see https://github.com/python/cpython/issues/139894 + ## Pedantic 2.3.1 - improve robustness of `WithDecoratedMethods` diff --git a/pedantic/decorators/fn_deco_in_subprocess.py b/pedantic/decorators/fn_deco_in_subprocess.py index dd4af36..8809d49 100644 --- a/pedantic/decorators/fn_deco_in_subprocess.py +++ b/pedantic/decorators/fn_deco_in_subprocess.py @@ -103,18 +103,11 @@ async def calculate_in_subprocess(func: Callable[..., Union[T, Awaitable[T]]], * return result -def _inner(tx: Connection, fun: Callable[..., Union[T, Awaitable[T]]], *a, new_thread: bool = False, **kw_args) -> None: +def _inner(tx: Connection, fun: Callable[..., Union[T, Awaitable[T]]], *a, **kw_args) -> None: """ This runs in another process. """ event_loop = None if inspect.iscoroutinefunction(fun): - if not new_thread: # see https://stackoverflow.com/a/79785720/10975692 - import threading - t = threading.Thread(target=_inner, args=(tx, fun, *a), kwargs=(kw_args | {"new_thread": True})) - t.start() - t.join() - return - event_loop = asyncio.new_event_loop() asyncio.set_event_loop(event_loop) diff --git a/pyproject.toml b/pyproject.toml index fb845d4..8be9a88 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "pedantic" -version = "2.3.1" +version = "2.3.2" description = "Some useful Python decorators for cleaner software development." readme = "README.md" requires-python = ">=3.11" From 7b671f8e4663719d3c7808748fa0b4738f719948 Mon Sep 17 00:00:00 2001 From: Willi Sontopski <32729196+LostInDarkMath@users.noreply.github.com> Date: Sun, 7 Dec 2025 14:28:26 +0100 Subject: [PATCH 2/2] check-latest: true --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d137fdb..b582698 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,6 +17,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + check-latest: true - name: Install dependencies run: | python -m pip install --upgrade pip