Skip to content

chore(mixins): use inspect.iscoroutinefunction in decorators#107

Merged
pratyush618 merged 1 commit into
masterfrom
chore/decorators-asyncio-boundary
May 2, 2026
Merged

chore(mixins): use inspect.iscoroutinefunction in decorators#107
pratyush618 merged 1 commit into
masterfrom
chore/decorators-asyncio-boundary

Conversation

@pratyush618
Copy link
Copy Markdown
Collaborator

Summary

After this change, the boundary is machine-checkable with a single grep:

```
$ grep -rn "import asyncio" py_src/taskito/ | grep -v -E "(async_support/|contrib/fastapi.py)"

(empty)

```

Test plan

  • uv run python -m pytest tests/python/ -v — 488 passed, 9 skipped (no regressions in test_async_* which exercise the _taskito_is_async flag set at this call site)
  • uv run ruff check py_src/ tests/ — clean
  • uv run mypy py_src/taskito/ --no-incremental — clean
  • cargo check --workspace — clean
  • grep -rn "import asyncio" py_src/taskito/ | grep -v -E "(async_support/|contrib/fastapi\.py)" returns empty

`import asyncio` is reserved for async_support/, app.py, and contrib/fastapi.py
per the project's async-separation boundary. `inspect.iscoroutinefunction`
has identical semantics for detecting `async def` functions.
@github-actions github-actions Bot added the python label May 2, 2026
@pratyush618 pratyush618 merged commit 4354631 into master May 2, 2026
30 of 33 checks passed
@pratyush618 pratyush618 deleted the chore/decorators-asyncio-boundary branch May 2, 2026 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant