anyquart 0.2.0__tar.gz → 0.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. {anyquart-0.2.0 → anyquart-0.2.1}/PKG-INFO +13 -3
  2. {anyquart-0.2.0 → anyquart-0.2.1}/README.md +5 -1
  3. {anyquart-0.2.0 → anyquart-0.2.1}/pyproject.toml +14 -7
  4. {anyquart-0.2.0 → anyquart-0.2.1}/src/anyquart/utils.py +18 -9
  5. {anyquart-0.2.0 → anyquart-0.2.1}/LICENSE.txt +0 -0
  6. {anyquart-0.2.0 → anyquart-0.2.1}/src/anyquart/__init__.py +0 -0
  7. {anyquart-0.2.0 → anyquart-0.2.1}/src/anyquart/__main__.py +0 -0
  8. {anyquart-0.2.0 → anyquart-0.2.1}/src/anyquart/app.py +0 -0
  9. {anyquart-0.2.0 → anyquart-0.2.1}/src/anyquart/asgi.py +0 -0
  10. {anyquart-0.2.0 → anyquart-0.2.1}/src/anyquart/blueprints.py +0 -0
  11. {anyquart-0.2.0 → anyquart-0.2.1}/src/anyquart/cli.py +0 -0
  12. {anyquart-0.2.0 → anyquart-0.2.1}/src/anyquart/config.py +0 -0
  13. {anyquart-0.2.0 → anyquart-0.2.1}/src/anyquart/ctx.py +0 -0
  14. {anyquart-0.2.0 → anyquart-0.2.1}/src/anyquart/datastructures.py +0 -0
  15. {anyquart-0.2.0 → anyquart-0.2.1}/src/anyquart/debug.py +0 -0
  16. {anyquart-0.2.0 → anyquart-0.2.1}/src/anyquart/formparser.py +0 -0
  17. {anyquart-0.2.0 → anyquart-0.2.1}/src/anyquart/globals.py +0 -0
  18. {anyquart-0.2.0 → anyquart-0.2.1}/src/anyquart/helpers.py +0 -0
  19. {anyquart-0.2.0 → anyquart-0.2.1}/src/anyquart/json/__init__.py +0 -0
  20. {anyquart-0.2.0 → anyquart-0.2.1}/src/anyquart/json/provider.py +0 -0
  21. {anyquart-0.2.0 → anyquart-0.2.1}/src/anyquart/json/tag.py +0 -0
  22. {anyquart-0.2.0 → anyquart-0.2.1}/src/anyquart/logging.py +0 -0
  23. {anyquart-0.2.0 → anyquart-0.2.1}/src/anyquart/py.typed +0 -0
  24. {anyquart-0.2.0 → anyquart-0.2.1}/src/anyquart/routing.py +0 -0
  25. {anyquart-0.2.0 → anyquart-0.2.1}/src/anyquart/sessions.py +0 -0
  26. {anyquart-0.2.0 → anyquart-0.2.1}/src/anyquart/signals.py +0 -0
  27. {anyquart-0.2.0 → anyquart-0.2.1}/src/anyquart/templating.py +0 -0
  28. {anyquart-0.2.0 → anyquart-0.2.1}/src/anyquart/testing/__init__.py +0 -0
  29. {anyquart-0.2.0 → anyquart-0.2.1}/src/anyquart/testing/app.py +0 -0
  30. {anyquart-0.2.0 → anyquart-0.2.1}/src/anyquart/testing/client.py +0 -0
  31. {anyquart-0.2.0 → anyquart-0.2.1}/src/anyquart/testing/connections.py +0 -0
  32. {anyquart-0.2.0 → anyquart-0.2.1}/src/anyquart/testing/utils.py +0 -0
  33. {anyquart-0.2.0 → anyquart-0.2.1}/src/anyquart/typing.py +0 -0
  34. {anyquart-0.2.0 → anyquart-0.2.1}/src/anyquart/views.py +0 -0
  35. {anyquart-0.2.0 → anyquart-0.2.1}/src/anyquart/wrappers/__init__.py +0 -0
  36. {anyquart-0.2.0 → anyquart-0.2.1}/src/anyquart/wrappers/base.py +0 -0
  37. {anyquart-0.2.0 → anyquart-0.2.1}/src/anyquart/wrappers/request.py +0 -0
  38. {anyquart-0.2.0 → anyquart-0.2.1}/src/anyquart/wrappers/response.py +0 -0
  39. {anyquart-0.2.0 → anyquart-0.2.1}/src/anyquart/wrappers/websocket.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: anyquart
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: A fork of Quart that uses AnyIO
5
5
  Author-email: pgjones <philip.graham.jones@googlemail.com>, NIYONSHUTI Emmanuel <emmanuelniyonshuti13@gmail.com>
6
6
  Maintainer-email: NIYONSHUTI Emmanuel <emmanuelniyonshuti13@gmail.com>
@@ -12,7 +12,13 @@ Classifier: Environment :: Web Environment
12
12
  Classifier: Framework :: Flask
13
13
  Classifier: Intended Audience :: Developers
14
14
  Classifier: Operating System :: OS Independent
15
- Classifier: Programming Language :: Python
15
+ Classifier: Programming Language :: Python :: 3 :: Only
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Programming Language :: Python :: 3.14
21
+ Classifier: Programming Language :: Python :: 3.15
16
22
  Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
17
23
  Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
18
24
  Classifier: Typing :: Typed
@@ -40,7 +46,11 @@ Quart runs on Asyncio and when you want to run it on Trio event loop you use [qu
40
46
 
41
47
  AnyQuart is [Quart](https://github.com/pallets/quart) running on [AnyIO](https://github.com/agronholm/anyio). It is a fork of Quart 0.20.1.
42
48
 
43
-
49
+ [![Tests](https://github.com/EmmanuelNiyonshuti/anyquart/actions/workflows/tests.yaml/badge.svg)](https://github.com/EmmanuelNiyonshuti/anyquart/actions)
50
+ [![PyPI](https://img.shields.io/pypi/v/anyquart.svg)](https://pypi.org/project/anyquart/)
51
+ [![Python](https://img.shields.io/pypi/pyversions/anyquart.svg)](https://pypi.org/project/anyquart/)
52
+ [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
53
+ ![t](https://img.shields.io/badge/status-maintained-yellow.svg)
44
54
 
45
55
  ## Differences from Quart
46
56
  `AnyQuart` and `Quart` are essentially the same thing. The only difference is the name and the internals(Asyncio replaced with AnyIO). This also means the testing setup changes, which is explained in the [Testing](#testing) section below.
@@ -4,7 +4,11 @@ Quart runs on Asyncio and when you want to run it on Trio event loop you use [qu
4
4
 
5
5
  AnyQuart is [Quart](https://github.com/pallets/quart) running on [AnyIO](https://github.com/agronholm/anyio). It is a fork of Quart 0.20.1.
6
6
 
7
-
7
+ [![Tests](https://github.com/EmmanuelNiyonshuti/anyquart/actions/workflows/tests.yaml/badge.svg)](https://github.com/EmmanuelNiyonshuti/anyquart/actions)
8
+ [![PyPI](https://img.shields.io/pypi/v/anyquart.svg)](https://pypi.org/project/anyquart/)
9
+ [![Python](https://img.shields.io/pypi/pyversions/anyquart.svg)](https://pypi.org/project/anyquart/)
10
+ [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
11
+ ![t](https://img.shields.io/badge/status-maintained-yellow.svg)
8
12
 
9
13
  ## Differences from Quart
10
14
  `AnyQuart` and `Quart` are essentially the same thing. The only difference is the name and the internals(Asyncio replaced with AnyIO). This also means the testing setup changes, which is explained in the [Testing](#testing) section below.
@@ -1,6 +1,10 @@
1
+ [build-system]
2
+ requires = ["flit_core >=3.11,<5"]
3
+ build-backend = "flit_core.buildapi"
4
+
1
5
  [project]
2
6
  name = "anyquart"
3
- version = "0.2.0"
7
+ version = "0.2.1"
4
8
  description = "A fork of Quart that uses AnyIO"
5
9
  readme = "README.md"
6
10
  license = "MIT"
@@ -16,7 +20,13 @@ classifiers = [
16
20
  "Framework :: Flask",
17
21
  "Intended Audience :: Developers",
18
22
  "Operating System :: OS Independent",
19
- "Programming Language :: Python",
23
+ "Programming Language :: Python :: 3 :: Only",
24
+ "Programming Language :: Python :: 3.10",
25
+ "Programming Language :: Python :: 3.11",
26
+ "Programming Language :: Python :: 3.12",
27
+ "Programming Language :: Python :: 3.13",
28
+ "Programming Language :: Python :: 3.14",
29
+ "Programming Language :: Python :: 3.15",
20
30
  "Topic :: Internet :: WWW/HTTP :: Dynamic Content",
21
31
  "Topic :: Software Development :: Libraries :: Application Frameworks",
22
32
  "Typing :: Typed",
@@ -75,10 +85,6 @@ typing = [
75
85
  "pytest",
76
86
  ]
77
87
 
78
- [build-system]
79
- requires = ["flit-core<4"]
80
- build-backend = "flit_core.buildapi"
81
-
82
88
  [tool.flit.module]
83
89
  name = "anyquart"
84
90
 
@@ -91,6 +97,7 @@ testpaths = ["tests"]
91
97
  filterwarnings = [
92
98
  "error",
93
99
  ]
100
+ anyio_mode = "auto"
94
101
 
95
102
  [tool.coverage.run]
96
103
  branch = true
@@ -148,7 +155,7 @@ order-by-type = false
148
155
 
149
156
  [tool.tox]
150
157
  env_list = [
151
- "py3.14", "py3.13", "py3.12", "py3.11", "py3.10",
158
+ "py3.15", "py3.14", "py3.13", "py3.12", "py3.11", "py3.10",
152
159
  "style",
153
160
  "typing",
154
161
  "docs",
@@ -5,12 +5,15 @@ import os
5
5
  from collections.abc import AsyncIterator
6
6
  from collections.abc import Callable
7
7
  from collections.abc import Coroutine
8
+ from collections.abc import Generator
8
9
  from collections.abc import Iterable
9
10
  from collections.abc import Iterator
10
11
  from functools import partial
11
12
  from functools import wraps
12
13
  from pathlib import Path
13
14
  from typing import Any
15
+ from typing import overload
16
+ from typing import ParamSpec
14
17
  from typing import TYPE_CHECKING
15
18
  from typing import TypeVar
16
19
 
@@ -22,6 +25,9 @@ from .typing import FilePath
22
25
  if TYPE_CHECKING:
23
26
  from .wrappers.response import Response # noqa: F401
24
27
 
28
+ T = TypeVar("T")
29
+ P = ParamSpec("P")
30
+
25
31
 
26
32
  def file_path_to_path(*paths: FilePath) -> Path:
27
33
  # Flask supports bytes paths
@@ -34,7 +40,17 @@ def file_path_to_path(*paths: FilePath) -> Path:
34
40
  return Path(*safe_paths)
35
41
 
36
42
 
37
- def run_sync(func: Callable[..., Any]) -> Callable[..., Coroutine[None, None, Any]]:
43
+ @overload
44
+ def run_sync(
45
+ func: Callable[P, Generator[T, None, None]],
46
+ ) -> Callable[P, Coroutine[None, None, AsyncIterator[T]]]: ...
47
+
48
+
49
+ @overload
50
+ def run_sync(func: Callable[P, T]) -> Callable[P, Coroutine[None, None, T]]: ...
51
+
52
+
53
+ def run_sync(func: Callable[P, Any]) -> Callable[P, Coroutine[None, None, Any]]:
38
54
  """Ensure that the sync function is run within the worker thread.
39
55
 
40
56
  This ensures that synchronous functions do not
@@ -42,7 +58,7 @@ def run_sync(func: Callable[..., Any]) -> Callable[..., Coroutine[None, None, An
42
58
  """
43
59
 
44
60
  @wraps(func)
45
- async def _wrapper(*args: Any, **kwargs: Any) -> Any:
61
+ async def _wrapper(*args: P.args, **kwargs: P.kwargs) -> Any:
46
62
  result = await anyio.to_thread.run_sync(partial(func, *args, **kwargs))
47
63
  if inspect.isgenerator(result):
48
64
  return run_sync_iterable(result)
@@ -53,9 +69,6 @@ def run_sync(func: Callable[..., Any]) -> Callable[..., Coroutine[None, None, An
53
69
  return _wrapper
54
70
 
55
71
 
56
- T = TypeVar("T")
57
-
58
-
59
72
  class _StopIteration(Exception): # noqa: N818
60
73
  pass
61
74
 
@@ -69,10 +82,6 @@ def _next(iterator: Iterator[T]) -> T:
69
82
 
70
83
  def run_sync_iterable(iterable: Iterator[T]) -> AsyncIterator[T]:
71
84
  async def _gen_wrapper() -> AsyncIterator[T]:
72
- # Wrap the generator such that each iteration runs
73
- # in the worker thread. Then rationalise the raised
74
- # errors so that it ends.
75
-
76
85
  while True:
77
86
  try:
78
87
  yield await anyio.to_thread.run_sync(_next, iterable)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes