pyview-web 0.0.8a0__tar.gz → 0.0.9a0__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.

Potentially problematic release.


This version of pyview-web might be problematic. Click here for more details.

Files changed (42) hide show
  1. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/PKG-INFO +14 -2
  2. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyproject.toml +4 -3
  3. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyview/auth/required.py +14 -4
  4. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/readme.md +12 -0
  5. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/LICENSE +0 -0
  6. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyview/__init__.py +0 -0
  7. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyview/assets/js/app.js +0 -0
  8. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyview/assets/package-lock.json +0 -0
  9. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyview/assets/package.json +0 -0
  10. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyview/auth/__init__.py +0 -0
  11. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyview/auth/provider.py +0 -0
  12. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyview/changesets/__init__.py +0 -0
  13. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyview/changesets/changesets.py +0 -0
  14. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyview/csrf.py +0 -0
  15. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyview/events.py +0 -0
  16. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyview/js.py +0 -0
  17. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyview/live_routes.py +0 -0
  18. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyview/live_socket.py +0 -0
  19. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyview/live_view.py +0 -0
  20. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyview/pyview.py +0 -0
  21. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyview/secret.py +0 -0
  22. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyview/session.py +0 -0
  23. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyview/static/assets/app.js +0 -0
  24. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyview/template/__init__.py +0 -0
  25. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyview/template/live_template.py +0 -0
  26. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyview/template/root_template.py +0 -0
  27. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyview/template/serializer.py +0 -0
  28. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyview/test_csrf.py +0 -0
  29. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyview/vendor/__init__.py +0 -0
  30. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyview/vendor/flet/pubsub/__init__.py +0 -0
  31. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyview/vendor/flet/pubsub/pub_sub.py +0 -0
  32. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyview/vendor/ibis/__init__.py +0 -0
  33. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyview/vendor/ibis/compiler.py +0 -0
  34. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyview/vendor/ibis/context.py +0 -0
  35. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyview/vendor/ibis/errors.py +0 -0
  36. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyview/vendor/ibis/filters.py +0 -0
  37. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyview/vendor/ibis/loaders.py +0 -0
  38. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyview/vendor/ibis/nodes.py +0 -0
  39. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyview/vendor/ibis/template.py +0 -0
  40. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyview/vendor/ibis/tree.py +0 -0
  41. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyview/vendor/ibis/utils.py +0 -0
  42. {pyview_web-0.0.8a0 → pyview_web-0.0.9a0}/pyview/ws_handler.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyview-web
3
- Version: 0.0.8a0
3
+ Version: 0.0.9a0
4
4
  Summary: LiveView in Python
5
5
  Home-page: https://pyview.rocks
6
6
  License: MIT
@@ -34,7 +34,7 @@ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
34
34
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
35
35
  Classifier: Typing :: Typed
36
36
  Requires-Dist: APScheduler (==3.9.1.post1)
37
- Requires-Dist: fastapi (==0.89.1)
37
+ Requires-Dist: fastapi (==0.111.0)
38
38
  Requires-Dist: itsdangerous (>=2.1.2,<3.0.0)
39
39
  Requires-Dist: markupsafe (>=2.1.2,<3.0.0)
40
40
  Requires-Dist: psutil (>=5.9.4,<6.0.0)
@@ -57,10 +57,22 @@ PyView enables dynamic, real-time web apps, using server-rendered HTML.
57
57
 
58
58
  `pip install pyview-web`
59
59
 
60
+ ## Quickstart
61
+
62
+ There's a [cookiecutter](https://github.com/cookiecutter/cookiecutter) template available
63
+
64
+ ```
65
+ cookiecutter gh:ogrodnek/pyview-cookiecutter
66
+ ```
67
+
60
68
  # Live Examples
61
69
 
62
70
  [https://examples.pyview.rocks/](https://examples.pyview.rocks/)
63
71
 
72
+ ## Other Examples
73
+
74
+ - [pyview AI chat](https://github.com/pyview/pyview-example-ai-chat)
75
+
64
76
  ## Simple Counter
65
77
 
66
78
  [See it live!](https://examples.pyview.rocks/count)
@@ -5,7 +5,7 @@ packages = [
5
5
  { include = "pyview" },
6
6
  ]
7
7
 
8
- version = "0.0.8a"
8
+ version = "0.0.9a"
9
9
  description = "LiveView in Python"
10
10
  authors = ["Larry Ogrodnek <ogrodnek@gmail.com>"]
11
11
  license = "MIT"
@@ -43,7 +43,7 @@ classifiers = [
43
43
 
44
44
  [tool.poetry.dependencies]
45
45
  python = "^3.9.16"
46
- fastapi = "0.89.1"
46
+ fastapi = "0.111.0"
47
47
  uvicorn = "0.20.0"
48
48
  wsproto = "1.2.0"
49
49
  APScheduler = "3.9.1.post1"
@@ -53,7 +53,7 @@ itsdangerous = "^2.1.2"
53
53
 
54
54
  [tool.poetry.group.dev.dependencies]
55
55
  pytest = "^6.0.0"
56
- black = "22.12.0"
56
+ black = "24.3.0"
57
57
  pyright = "1.1.292"
58
58
  aiohttp = "^3.8.4"
59
59
 
@@ -72,6 +72,7 @@ build-backend = "poetry.core.masonry.api"
72
72
  [tool.pyright]
73
73
  exclude = [
74
74
  ".venv",
75
+ "examples/.venv",
75
76
  "**/vendor",
76
77
  "**/node_modules",
77
78
  "**/__pycache__",
@@ -4,8 +4,14 @@ from starlette.websockets import WebSocket
4
4
  from starlette.authentication import requires as starlette_requires, has_required_scope
5
5
  from .provider import AuthProvider, AuthProviderFactory
6
6
  from pyview import LiveView
7
+ import sys
7
8
 
8
- _CallableType = typing.TypeVar("_CallableType", bound=typing.Callable)
9
+ if sys.version_info >= (3, 10): # pragma: no cover
10
+ from typing import ParamSpec
11
+ else: # pragma: no cover
12
+ from typing_extensions import ParamSpec
13
+
14
+ _P = ParamSpec("_P")
9
15
 
10
16
 
11
17
  @dataclass
@@ -14,10 +20,12 @@ class RequiredScopeAuthProvider(AuthProvider):
14
20
  status_code: int = 403
15
21
  redirect: typing.Optional[str] = None
16
22
 
17
- def wrap(self, func: _CallableType) -> _CallableType:
23
+ def wrap(
24
+ self, func: typing.Callable[_P, typing.Any]
25
+ ) -> typing.Callable[_P, typing.Any]:
18
26
  return starlette_requires(self.scopes, self.status_code, self.redirect)(func)
19
27
 
20
- def has_required_auth(self, websocket: WebSocket) -> bool:
28
+ async def has_required_auth(self, websocket: WebSocket) -> bool:
21
29
  return has_required_scope(websocket, self.scopes)
22
30
 
23
31
 
@@ -28,6 +36,8 @@ def requires(
28
36
  ) -> typing.Callable[[type[LiveView]], type[LiveView]]:
29
37
  def decorator(cls: type[LiveView]) -> type[LiveView]:
30
38
  scopes_list = [scopes] if isinstance(scopes, str) else list(scopes)
31
- return AuthProviderFactory.set(cls, RequiredScopeAuthProvider(scopes_list, status_code, redirect))
39
+ return AuthProviderFactory.set(
40
+ cls, RequiredScopeAuthProvider(scopes_list, status_code, redirect)
41
+ )
32
42
 
33
43
  return decorator
@@ -12,10 +12,22 @@ PyView enables dynamic, real-time web apps, using server-rendered HTML.
12
12
 
13
13
  `pip install pyview-web`
14
14
 
15
+ ## Quickstart
16
+
17
+ There's a [cookiecutter](https://github.com/cookiecutter/cookiecutter) template available
18
+
19
+ ```
20
+ cookiecutter gh:ogrodnek/pyview-cookiecutter
21
+ ```
22
+
15
23
  # Live Examples
16
24
 
17
25
  [https://examples.pyview.rocks/](https://examples.pyview.rocks/)
18
26
 
27
+ ## Other Examples
28
+
29
+ - [pyview AI chat](https://github.com/pyview/pyview-example-ai-chat)
30
+
19
31
  ## Simple Counter
20
32
 
21
33
  [See it live!](https://examples.pyview.rocks/count)
File without changes
File without changes