Skip to content

Commit e28e66e

Browse files
authored
Also test CPython 3.14 (V2) (zauberzeug#5243)
### Motivation Python 3.14 is released! https://www.python.org/downloads/release/python-3140/ **Real motivation: zauberzeug#5237 did not work out...** ### Implementation This pull request adds support for Python 3.14 to the project and addresses compatibility issues with certain dependencies. The most important changes are grouped below: **Python 3.14 support and dependency compatibility:** * Added Python 3.14 to the test matrix in the GitHub Actions workflow to ensure CI coverage for the new version. * Updated the `vbuild` dependency in `pyproject.toml` to use a specific Git commit for Python 3.14, as the released version is not yet compatible. * Added a conditional requirement for `pydantic` in `pyproject.toml` to exclude versions 2.0–2.11 for Python 3.14 and above, since these versions are incompatible. **Test script adjustments:** * Modified `test_startup.sh` to skip the `examples/ai_interface` test when running under Python 3.14, due to its reliance on Pydantic V1 which is not compatible with Python 3.14. ### Progress - [x] I chose a meaningful title that completes the sentence: "If applied, this PR will..." - [x] The implementation is complete (We'll stare at the pipeline to make that conclusion). - [x] Pytests have been added (or are not necessary). - [x] Documentation has been added (or is not necessary). --------- Co-authored-by: evnchn <>
1 parent 1bb276c commit e28e66e

File tree

6 files changed

+234
-172
lines changed

6 files changed

+234
-172
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
test:
2929
strategy:
3030
matrix:
31-
python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
31+
python: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
3232
fail-fast: false
3333
runs-on: ubuntu-latest
3434
timeout-minutes: 40

nicegui/helpers.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
from __future__ import annotations
22

3-
import asyncio
43
import functools
54
import hashlib
65
import os
76
import socket
87
import struct
8+
import sys
99
import threading
1010
import time
1111
import webbrowser
@@ -22,6 +22,11 @@
2222

2323
_shown_warnings: set[str] = set()
2424

25+
if sys.version_info < (3, 13):
26+
from asyncio import iscoroutinefunction
27+
else:
28+
from inspect import iscoroutinefunction
29+
2530

2631
def warn_once(message: str, *, stack_info: bool = False) -> None:
2732
"""Print a warning message only once."""
@@ -48,7 +53,7 @@ def is_coroutine_function(obj: Any) -> bool:
4853
"""
4954
while isinstance(obj, functools.partial):
5055
obj = obj.func
51-
return asyncio.iscoroutinefunction(obj)
56+
return iscoroutinefunction(obj)
5257

5358

5459
def expects_arguments(func: Callable) -> bool:

0 commit comments

Comments
 (0)