Skip to content

fix: Use inspect.iscoroutinefunction instead of asyncio.iscoroutinefunction to address deprecation warning in Python 3.14+#4405

Merged
sobolevn merged 3 commits intolitestar-org:mainfrom
edgarrmondragon:fix/inspect-iscoroutine
Oct 6, 2025
Merged

fix: Use inspect.iscoroutinefunction instead of asyncio.iscoroutinefunction to address deprecation warning in Python 3.14+#4405
sobolevn merged 3 commits intolitestar-org:mainfrom
edgarrmondragon:fix/inspect-iscoroutine

Conversation

@edgarrmondragon
Copy link
Copy Markdown
Contributor

@edgarrmondragon edgarrmondragon commented Oct 6, 2025

Description

Fixes a deprecation warning introduced in Python 3.14.

I've tested this change with

$ uv run pytest -q tests/unit/test_utils/test_predicates.py::test_is_async_callable
..........                                                                   [100%]
10 passed in 0.10s

Closes

NA.

@edgarrmondragon edgarrmondragon requested review from a team as code owners October 6, 2025 03:30
@edgarrmondragon edgarrmondragon changed the title fix: Use inspect.iscoroutinefunction instead of asyncio.iscoroutinefunction to address deprecation warning in Python 3.13+ fix: Use inspect.iscoroutinefunction instead of asyncio.iscoroutinefunction to address deprecation warning in Python 3.14+ Oct 6, 2025
@edgarrmondragon
Copy link
Copy Markdown
Contributor Author

edgarrmondragon commented Oct 6, 2025

The error on Python 3.9 is legit, moving to draft while I figure it out...

@edgarrmondragon edgarrmondragon marked this pull request as draft October 6, 2025 03:38
@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.83%. Comparing base (1a646b5) to head (97d6eb1).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4405   +/-   ##
=======================================
  Coverage   97.83%   97.83%           
=======================================
  Files         296      296           
  Lines       15286    15288    +2     
  Branches     1711     1711           
=======================================
+ Hits        14955    14957    +2     
  Misses        189      189           
  Partials      142      142           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…efunction` to address deprecation warning in Python 3.13+
Comment thread litestar/utils/predicates.py
@edgarrmondragon edgarrmondragon marked this pull request as ready for review October 6, 2025 04:27
Copy link
Copy Markdown
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, thank you!

Comment thread litestar/utils/predicates.py Outdated
Co-authored-by: sobolevn <mail@sobolevn.me>
Comment thread litestar/utils/predicates.py
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Oct 6, 2025

Documentation preview will be available shortly at https://litestar-org.github.io/litestar-docs-preview/4405

@sobolevn sobolevn merged commit 2cf4575 into litestar-org:main Oct 6, 2025
28 checks passed
@edgarrmondragon edgarrmondragon deleted the fix/inspect-iscoroutine branch October 6, 2025 18:20
provinzkraut pushed a commit that referenced this pull request Dec 13, 2025
…`asyncio.iscoroutinefunction` (#4405)

Co-authored-by: sobolevn <mail@sobolevn.me>
(cherry picked from commit 2cf4575)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants