flet-web 1.0.0__tar.gz → 1.0.0.dev2__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 flet-web might be problematic. Click here for more details.
- {flet_web-1.0.0 → flet_web-1.0.0.dev2}/PKG-INFO +2 -2
- {flet_web-1.0.0 → flet_web-1.0.0.dev2}/pyproject.toml +2 -2
- {flet_web-1.0.0 → flet_web-1.0.0.dev2}/src/flet_web/fastapi/flet_static_files.py +1 -4
- {flet_web-1.0.0 → flet_web-1.0.0.dev2}/src/flet_web/patch_index.py +6 -21
- flet_web-1.0.0.dev2/src/flet_web/version.py +1 -0
- {flet_web-1.0.0 → flet_web-1.0.0.dev2}/src/flet_web.egg-info/PKG-INFO +2 -2
- {flet_web-1.0.0 → flet_web-1.0.0.dev2}/src/flet_web.egg-info/SOURCES.txt +1 -2
- {flet_web-1.0.0 → flet_web-1.0.0.dev2}/src/flet_web.egg-info/requires.txt +1 -1
- flet_web-1.0.0/src/flet_web/version.py +0 -1
- flet_web-1.0.0/tests/test_patch_index.py +0 -34
- {flet_web-1.0.0 → flet_web-1.0.0.dev2}/README.md +0 -0
- {flet_web-1.0.0 → flet_web-1.0.0.dev2}/setup.cfg +0 -0
- {flet_web-1.0.0 → flet_web-1.0.0.dev2}/src/flet_web/__init__.py +0 -0
- {flet_web-1.0.0 → flet_web-1.0.0.dev2}/src/flet_web/fastapi/__init__.py +0 -0
- {flet_web-1.0.0 → flet_web-1.0.0.dev2}/src/flet_web/fastapi/app.py +0 -0
- {flet_web-1.0.0 → flet_web-1.0.0.dev2}/src/flet_web/fastapi/flet_app.py +0 -0
- {flet_web-1.0.0 → flet_web-1.0.0.dev2}/src/flet_web/fastapi/flet_app_manager.py +0 -0
- {flet_web-1.0.0 → flet_web-1.0.0.dev2}/src/flet_web/fastapi/flet_fastapi.py +0 -0
- {flet_web-1.0.0 → flet_web-1.0.0.dev2}/src/flet_web/fastapi/flet_oauth.py +0 -0
- {flet_web-1.0.0 → flet_web-1.0.0.dev2}/src/flet_web/fastapi/flet_upload.py +0 -0
- {flet_web-1.0.0 → flet_web-1.0.0.dev2}/src/flet_web/fastapi/oauth_state.py +0 -0
- {flet_web-1.0.0 → flet_web-1.0.0.dev2}/src/flet_web/fastapi/serve_fastapi_web_app.py +0 -0
- {flet_web-1.0.0 → flet_web-1.0.0.dev2}/src/flet_web/uploads.py +0 -0
- {flet_web-1.0.0 → flet_web-1.0.0.dev2}/src/flet_web.egg-info/dependency_links.txt +0 -0
- {flet_web-1.0.0 → flet_web-1.0.0.dev2}/src/flet_web.egg-info/top_level.txt +0 -0
- {flet_web-1.0.0 → flet_web-1.0.0.dev2}/tests/test_loading_logo.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: flet-web
|
|
3
|
-
Version: 1.0.0
|
|
3
|
+
Version: 1.0.0.dev2
|
|
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.0.0
|
|
12
|
+
Requires-Dist: flet==1.0.0.dev2
|
|
13
13
|
Requires-Dist: fastapi>=0.115.12
|
|
14
14
|
Requires-Dist: uvicorn[standard]>=0.35.0
|
|
15
15
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "flet-web"
|
|
3
|
-
version = "1.0.0"
|
|
3
|
+
version = "1.0.0.dev2"
|
|
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.0.0",
|
|
10
|
+
"flet==1.0.0.dev2",
|
|
11
11
|
"fastapi >=0.115.12",
|
|
12
12
|
"uvicorn[standard] >=0.35.0"
|
|
13
13
|
]
|
|
@@ -177,10 +177,7 @@ class FletStaticFiles(StaticFiles):
|
|
|
177
177
|
|
|
178
178
|
# "standard" web files
|
|
179
179
|
web_dir = get_package_web_dir()
|
|
180
|
-
|
|
181
|
-
logger.info(f"Web root set via FLET_WEB_PATH: {web_dir}")
|
|
182
|
-
else:
|
|
183
|
-
logger.info(f"Web root: {web_dir}")
|
|
180
|
+
logger.info(f"Web root: {web_dir}")
|
|
184
181
|
|
|
185
182
|
if not os.path.exists(web_dir):
|
|
186
183
|
raise RuntimeError(f"Web root path not found: {web_dir}")
|
|
@@ -16,7 +16,6 @@ def patch_index_html(
|
|
|
16
16
|
pyodide_pre: bool = False,
|
|
17
17
|
pyodide_script_path: str = "",
|
|
18
18
|
pyodide_version: Optional[str] = None,
|
|
19
|
-
app_package_url: Optional[str] = None,
|
|
20
19
|
web_renderer: WebRenderer = WebRenderer.AUTO,
|
|
21
20
|
route_url_strategy: RouteUrlStrategy = RouteUrlStrategy.PATH,
|
|
22
21
|
no_cdn: bool = False,
|
|
@@ -34,16 +33,9 @@ def patch_index_html(
|
|
|
34
33
|
websocket_endpoint_path: Optional websocket endpoint path.
|
|
35
34
|
app_name: Optional app name used for page title and iOS web-app title meta.
|
|
36
35
|
app_description: Optional app description meta content.
|
|
37
|
-
pyodide: Whether
|
|
38
|
-
the injected config either way, because a page carries whichever
|
|
39
|
-
mode it was generated for — `flet build web` bakes Pyodide in — and
|
|
40
|
-
serving that client from a Flet server has to turn it back off.
|
|
36
|
+
pyodide: Whether to enable Pyodide mode in injected runtime config.
|
|
41
37
|
pyodide_pre: Whether pre-release micropip packages are allowed.
|
|
42
38
|
pyodide_script_path: Path to Python entry script for Pyodide apps.
|
|
43
|
-
app_package_url: URL of the archive holding the app's Python code,
|
|
44
|
-
relative to the page. Written to the injected config, because a
|
|
45
|
-
page names whichever archive it was generated for while a
|
|
46
|
-
publisher writes its own.
|
|
47
39
|
web_renderer: Web renderer mode for the frontend runtime.
|
|
48
40
|
route_url_strategy: URL strategy used by frontend routing.
|
|
49
41
|
no_cdn: Whether CDN asset loading should be disabled.
|
|
@@ -57,25 +49,18 @@ def patch_index_html(
|
|
|
57
49
|
base_url = base_href.strip("/").strip()
|
|
58
50
|
base_url = "/" if base_url == "" else f"/{base_url}/"
|
|
59
51
|
|
|
60
|
-
index =
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
index,
|
|
64
|
-
count=1,
|
|
65
|
-
flags=re.IGNORECASE,
|
|
52
|
+
index = index.replace(
|
|
53
|
+
'<base href="/">',
|
|
54
|
+
f'<base href="{base_url}">',
|
|
66
55
|
)
|
|
67
56
|
|
|
68
57
|
app_config = []
|
|
69
58
|
|
|
70
|
-
|
|
71
|
-
app_config.append(f"flet.pyodide = {str(run_in_browser).lower()};")
|
|
72
|
-
|
|
73
|
-
if run_in_browser:
|
|
59
|
+
if pyodide and pyodide_script_path:
|
|
74
60
|
module_name = Path(pyodide_script_path).stem
|
|
61
|
+
app_config.append("flet.pyodide = true;")
|
|
75
62
|
app_config.append(f"flet.micropipIncludePre = {str(pyodide_pre).lower()};")
|
|
76
63
|
app_config.append(f'flet.pythonModuleName = "{module_name}";')
|
|
77
|
-
if app_package_url:
|
|
78
|
-
app_config.append(f'flet.appPackageUrl = "{app_package_url}";')
|
|
79
64
|
|
|
80
65
|
# Pin the Pyodide runtime URL for this build. The web client used to fall
|
|
81
66
|
# back to a hardcoded CDN URL when not in no-cdn mode; with multi-version
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
version = "1.0.0.dev2"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: flet-web
|
|
3
|
-
Version: 1.0.0
|
|
3
|
+
Version: 1.0.0.dev2
|
|
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.0.0
|
|
12
|
+
Requires-Dist: flet==1.0.0.dev2
|
|
13
13
|
Requires-Dist: fastapi>=0.115.12
|
|
14
14
|
Requires-Dist: uvicorn[standard]>=0.35.0
|
|
15
15
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
version = "1.0.0"
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
from html.parser import HTMLParser
|
|
2
|
-
from urllib.parse import urljoin
|
|
3
|
-
|
|
4
|
-
import pytest
|
|
5
|
-
|
|
6
|
-
from flet_web.patch_index import patch_index_html
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class BaseParser(HTMLParser):
|
|
10
|
-
def handle_starttag(self, tag, attrs):
|
|
11
|
-
if tag == "base":
|
|
12
|
-
self.href = dict(attrs)["href"]
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
@pytest.mark.parametrize(
|
|
16
|
-
"base_tag",
|
|
17
|
-
['<base href="/">', '<base href="/deployed/">', "<base href='/deployed/'>"],
|
|
18
|
-
)
|
|
19
|
-
@pytest.mark.parametrize("mount_path", ["/", "/apps/demo/"])
|
|
20
|
-
def test_client_scripts_resolve_under_server_mount(tmp_path, base_tag, mount_path):
|
|
21
|
-
index = tmp_path / "index.html"
|
|
22
|
-
index.write_text(
|
|
23
|
-
f"<html><head>{base_tag}<!-- fletAppConfig --></head>"
|
|
24
|
-
'<body><script src="flutter_bootstrap.js"></script></body></html>',
|
|
25
|
-
encoding="utf-8",
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
patch_index_html(str(index), base_href=mount_path)
|
|
29
|
-
|
|
30
|
-
parser = BaseParser()
|
|
31
|
-
parser.feed(index.read_text(encoding="utf-8"))
|
|
32
|
-
assert urljoin(parser.href, "flutter_bootstrap.js") == (
|
|
33
|
-
mount_path + "flutter_bootstrap.js"
|
|
34
|
-
)
|
|
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
|