Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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`

Expand Down
9 changes: 1 addition & 8 deletions pedantic/decorators/fn_deco_in_subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down