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 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"