flet-web 1.1.0.dev0__tar.gz → 1.1.0.dev1__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.
- {flet_web-1.1.0.dev0 → flet_web-1.1.0.dev1}/PKG-INFO +2 -2
- {flet_web-1.1.0.dev0 → flet_web-1.1.0.dev1}/pyproject.toml +2 -2
- {flet_web-1.1.0.dev0 → flet_web-1.1.0.dev1}/src/flet_web/fastapi/flet_fastapi.py +4 -3
- {flet_web-1.1.0.dev0 → flet_web-1.1.0.dev1}/src/flet_web/patch_index.py +1 -1
- flet_web-1.1.0.dev1/src/flet_web/version.py +1 -0
- {flet_web-1.1.0.dev0 → flet_web-1.1.0.dev1}/src/flet_web.egg-info/PKG-INFO +2 -2
- {flet_web-1.1.0.dev0 → flet_web-1.1.0.dev1}/src/flet_web.egg-info/SOURCES.txt +1 -0
- {flet_web-1.1.0.dev0 → flet_web-1.1.0.dev1}/src/flet_web.egg-info/requires.txt +1 -1
- flet_web-1.1.0.dev1/tests/test_fastapi.py +34 -0
- flet_web-1.1.0.dev0/src/flet_web/version.py +0 -1
- {flet_web-1.1.0.dev0 → flet_web-1.1.0.dev1}/README.md +0 -0
- {flet_web-1.1.0.dev0 → flet_web-1.1.0.dev1}/setup.cfg +0 -0
- {flet_web-1.1.0.dev0 → flet_web-1.1.0.dev1}/src/flet_web/__init__.py +0 -0
- {flet_web-1.1.0.dev0 → flet_web-1.1.0.dev1}/src/flet_web/fastapi/__init__.py +0 -0
- {flet_web-1.1.0.dev0 → flet_web-1.1.0.dev1}/src/flet_web/fastapi/app.py +0 -0
- {flet_web-1.1.0.dev0 → flet_web-1.1.0.dev1}/src/flet_web/fastapi/flet_app.py +0 -0
- {flet_web-1.1.0.dev0 → flet_web-1.1.0.dev1}/src/flet_web/fastapi/flet_app_manager.py +0 -0
- {flet_web-1.1.0.dev0 → flet_web-1.1.0.dev1}/src/flet_web/fastapi/flet_oauth.py +0 -0
- {flet_web-1.1.0.dev0 → flet_web-1.1.0.dev1}/src/flet_web/fastapi/flet_static_files.py +0 -0
- {flet_web-1.1.0.dev0 → flet_web-1.1.0.dev1}/src/flet_web/fastapi/flet_upload.py +0 -0
- {flet_web-1.1.0.dev0 → flet_web-1.1.0.dev1}/src/flet_web/fastapi/oauth_state.py +0 -0
- {flet_web-1.1.0.dev0 → flet_web-1.1.0.dev1}/src/flet_web/fastapi/serve_fastapi_web_app.py +0 -0
- {flet_web-1.1.0.dev0 → flet_web-1.1.0.dev1}/src/flet_web/uploads.py +0 -0
- {flet_web-1.1.0.dev0 → flet_web-1.1.0.dev1}/src/flet_web.egg-info/dependency_links.txt +0 -0
- {flet_web-1.1.0.dev0 → flet_web-1.1.0.dev1}/src/flet_web.egg-info/top_level.txt +0 -0
- {flet_web-1.1.0.dev0 → flet_web-1.1.0.dev1}/tests/test_loading_logo.py +0 -0
- {flet_web-1.1.0.dev0 → flet_web-1.1.0.dev1}/tests/test_patch_index.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: flet-web
|
|
3
|
-
Version: 1.1.0.
|
|
3
|
+
Version: 1.1.0.dev1
|
|
4
4
|
Summary: Flet web client in Flutter.
|
|
5
5
|
Author-email: "Appveyor Systems Inc." <hello@flet.dev>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -9,7 +9,7 @@ Project-URL: Repository, https://github.com/flet-dev/flet
|
|
|
9
9
|
Project-URL: Documentation, https://flet.dev/docs
|
|
10
10
|
Requires-Python: >=3.10
|
|
11
11
|
Description-Content-Type: text/markdown
|
|
12
|
-
Requires-Dist: flet==1.1.0.
|
|
12
|
+
Requires-Dist: flet==1.1.0.dev1
|
|
13
13
|
Requires-Dist: fastapi>=0.115.12
|
|
14
14
|
Requires-Dist: websockets>=13.0
|
|
15
15
|
Requires-Dist: uvicorn>=0.35.0
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "flet-web"
|
|
3
|
-
version = "1.1.0.
|
|
3
|
+
version = "1.1.0.dev1"
|
|
4
4
|
description = "Flet web client in Flutter."
|
|
5
5
|
authors = [{ name = "Appveyor Systems Inc.", email = "hello@flet.dev" }]
|
|
6
6
|
license = "Apache-2.0"
|
|
7
7
|
readme = "README.md"
|
|
8
8
|
requires-python = ">=3.10"
|
|
9
9
|
dependencies = [
|
|
10
|
-
"flet==1.1.0.
|
|
10
|
+
"flet==1.1.0.dev1",
|
|
11
11
|
"fastapi >=0.115.12",
|
|
12
12
|
"websockets >=13.0",
|
|
13
13
|
"uvicorn >=0.35.0",
|
|
@@ -15,6 +15,8 @@ from starlette.routing import BaseRoute
|
|
|
15
15
|
|
|
16
16
|
import flet_web.fastapi
|
|
17
17
|
|
|
18
|
+
_DEFAULT_RESPONSE_CLASS = Default(JSONResponse)
|
|
19
|
+
|
|
18
20
|
|
|
19
21
|
class FastAPI(fastapi.FastAPI):
|
|
20
22
|
"""
|
|
@@ -38,7 +40,7 @@ class FastAPI(fastapi.FastAPI):
|
|
|
38
40
|
openapi_tags: Optional[list[dict[str, Any]]] = None,
|
|
39
41
|
servers: Optional[list[dict[str, Union[str, Any]]]] = None,
|
|
40
42
|
dependencies: Optional[Sequence[Depends]] = None,
|
|
41
|
-
default_response_class: type[Response] =
|
|
43
|
+
default_response_class: type[Response] = _DEFAULT_RESPONSE_CLASS,
|
|
42
44
|
redirect_slashes: bool = True,
|
|
43
45
|
docs_url: Optional[str] = "/docs",
|
|
44
46
|
redoc_url: Optional[str] = "/redoc",
|
|
@@ -139,8 +141,7 @@ class FastAPI(fastapi.FastAPI):
|
|
|
139
141
|
terms_of_service=terms_of_service,
|
|
140
142
|
contact=contact,
|
|
141
143
|
license_info=license_info,
|
|
142
|
-
|
|
143
|
-
root_path=root_path,
|
|
144
|
+
root_path=root_path or openapi_prefix,
|
|
144
145
|
root_path_in_servers=root_path_in_servers,
|
|
145
146
|
responses=responses,
|
|
146
147
|
callbacks=callbacks,
|
|
@@ -85,7 +85,7 @@ def patch_index_html(
|
|
|
85
85
|
# loads it via dynamic `import()`. We can no longer use `.js` because
|
|
86
86
|
# Pyodide >= 0.29 throws "Classic web workers are not supported" inside
|
|
87
87
|
# any worker that has `importScripts` available — only classic workers
|
|
88
|
-
# have it. All supported Pyodide versions (0.27.
|
|
88
|
+
# have it. All supported Pyodide versions (0.27.8 / 0.29.5 / 314.0.7)
|
|
89
89
|
# ship `pyodide.mjs`.
|
|
90
90
|
if pyodide_version:
|
|
91
91
|
if no_cdn:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
version = "1.1.0.dev1"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: flet-web
|
|
3
|
-
Version: 1.1.0.
|
|
3
|
+
Version: 1.1.0.dev1
|
|
4
4
|
Summary: Flet web client in Flutter.
|
|
5
5
|
Author-email: "Appveyor Systems Inc." <hello@flet.dev>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -9,7 +9,7 @@ Project-URL: Repository, https://github.com/flet-dev/flet
|
|
|
9
9
|
Project-URL: Documentation, https://flet.dev/docs
|
|
10
10
|
Requires-Python: >=3.10
|
|
11
11
|
Description-Content-Type: text/markdown
|
|
12
|
-
Requires-Dist: flet==1.1.0.
|
|
12
|
+
Requires-Dist: flet==1.1.0.dev1
|
|
13
13
|
Requires-Dist: fastapi>=0.115.12
|
|
14
14
|
Requires-Dist: websockets>=13.0
|
|
15
15
|
Requires-Dist: uvicorn>=0.35.0
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import pytest
|
|
2
|
+
from fastapi.testclient import TestClient
|
|
3
|
+
|
|
4
|
+
from flet_web.fastapi import FastAPI
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@pytest.mark.parametrize(
|
|
8
|
+
("kwargs", "expected_root_path"),
|
|
9
|
+
[
|
|
10
|
+
({}, ""),
|
|
11
|
+
({"root_path": "/app"}, "/app"),
|
|
12
|
+
({"openapi_prefix": "/legacy"}, "/legacy"),
|
|
13
|
+
({"openapi_prefix": "/legacy", "root_path": "/app"}, "/app"),
|
|
14
|
+
],
|
|
15
|
+
)
|
|
16
|
+
def test_fastapi_root_path_and_lifecycle(kwargs, expected_root_path):
|
|
17
|
+
events = []
|
|
18
|
+
app = FastAPI(
|
|
19
|
+
**kwargs,
|
|
20
|
+
on_startup=[lambda: events.append("startup")],
|
|
21
|
+
on_shutdown=[lambda: events.append("shutdown")],
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
@app.get("/path")
|
|
25
|
+
def get_root_path():
|
|
26
|
+
return {"root_path": app.root_path}
|
|
27
|
+
|
|
28
|
+
with TestClient(app) as client:
|
|
29
|
+
assert events == ["startup"]
|
|
30
|
+
response = client.get("/path")
|
|
31
|
+
assert response.status_code == 200
|
|
32
|
+
assert response.json() == {"root_path": expected_root_path}
|
|
33
|
+
|
|
34
|
+
assert events == ["startup", "shutdown"]
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
version = "1.1.0.dev0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|