Skip to content

Commit 5f7d8fc

Browse files
committed
update
1 parent 2df848a commit 5f7d8fc

File tree

8 files changed

+326
-24
lines changed

8 files changed

+326
-24
lines changed

packages/py-gui/try-flet/Taskfile.yml

+10-24
Original file line numberDiff line numberDiff line change
@@ -15,36 +15,26 @@ env:
1515

1616

1717
tasks:
18-
19-
install:
20-
aliases: [ "i" ]
21-
cmds:
22-
- poetry install
23-
2418
pkg:
2519
cmds:
26-
- poetry {{ .CLI_ARGS }}
27-
28-
add:
29-
cmds:
30-
- poetry add flet loguru "typer[all]"
20+
- rye {{ .CLI_ARGS }}
3121

32-
run:demo:
33-
aliases: [ 'rd' ]
22+
run:template:
23+
aliases: [ 'rt' ]
3424
cmds:
35-
- poetry run flet run .
36-
dir: ./demo
25+
- rye run flet run src/flet_template/main.py
26+
dir: ./flet-template/
3727

3828
rel:macos:
3929
cmds:
40-
- flet build macos
30+
- rye run flet build macos
4131

4232
release:
4333
aliases: [ 'rel' ]
4434
cmds:
45-
- poetry run flet pack --help
35+
- rye run flet pack --help
4636
- |
47-
poetry run flet pack main.py
37+
rye run flet pack main.py
4838
--verbose \
4939
--name pyApp \
5040
--product-version 0.1.0 \
@@ -53,11 +43,7 @@ tasks:
5343
--bundle-id "com.trybetterapp.pyapp" \
5444
dir: ./demo
5545

56-
help:
57-
cmds:
58-
- poetry run flet --help
59-
6046
new:
6147
cmds:
62-
- poetry run flet create --help
63-
- poetry run flet create --verbose --template counter --project-name demo demo
48+
- rye run flet create --help
49+
- rye run flet create --verbose --template counter --project-name demo demo
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# python generated files
2+
__pycache__/
3+
*.py[oc]
4+
build/
5+
dist/
6+
wheels/
7+
*.egg-info
8+
9+
# venv
10+
.venv
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# flet-template
2+
3+
Describe your project here.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[project]
2+
name = "flet-template"
3+
version = "0.1.0"
4+
description = "Add your description here"
5+
authors = [
6+
{ name = "hhglory", email = "[email protected]" }
7+
]
8+
dependencies = [
9+
"flet>=0.24.1",
10+
]
11+
readme = "README.md"
12+
requires-python = ">= 3.8"
13+
14+
[build-system]
15+
requires = ["hatchling"]
16+
build-backend = "hatchling.build"
17+
18+
[tool.rye]
19+
managed = true
20+
dev-dependencies = []
21+
22+
[tool.hatch.metadata]
23+
allow-direct-references = true
24+
25+
[tool.hatch.build.targets.wheel]
26+
packages = ["src/flet_template"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# generated by rye
2+
# use `rye lock` or `rye sync` to update this lockfile
3+
#
4+
# last locked with the following flags:
5+
# pre: false
6+
# features: []
7+
# all-features: false
8+
# with-sources: false
9+
# generate-hashes: false
10+
# universal: false
11+
12+
-e file:.
13+
annotated-types==0.7.0
14+
# via pydantic
15+
anyio==4.6.2.post1
16+
# via httpx
17+
# via starlette
18+
# via watchfiles
19+
arrow==1.3.0
20+
# via cookiecutter
21+
binaryornot==0.4.4
22+
# via cookiecutter
23+
certifi==2024.8.30
24+
# via httpcore
25+
# via httpx
26+
# via requests
27+
chardet==5.2.0
28+
# via binaryornot
29+
charset-normalizer==3.4.0
30+
# via requests
31+
click==8.1.7
32+
# via cookiecutter
33+
# via uvicorn
34+
cookiecutter==2.6.0
35+
# via flet
36+
fastapi==0.115.4
37+
# via flet
38+
flet==0.24.1
39+
# via flet-template
40+
flet-core==0.24.1
41+
# via flet-runtime
42+
flet-runtime==0.24.1
43+
# via flet
44+
h11==0.14.0
45+
# via httpcore
46+
# via uvicorn
47+
httpcore==1.0.6
48+
# via httpx
49+
httptools==0.6.4
50+
# via uvicorn
51+
httpx==0.27.2
52+
# via flet-runtime
53+
idna==3.10
54+
# via anyio
55+
# via httpx
56+
# via requests
57+
jinja2==3.1.4
58+
# via cookiecutter
59+
markdown-it-py==3.0.0
60+
# via rich
61+
markupsafe==3.0.2
62+
# via jinja2
63+
mdurl==0.1.2
64+
# via markdown-it-py
65+
oauthlib==3.2.2
66+
# via flet-runtime
67+
packaging==23.2
68+
# via flet
69+
pydantic==2.9.2
70+
# via fastapi
71+
pydantic-core==2.23.4
72+
# via pydantic
73+
pygments==2.18.0
74+
# via rich
75+
pypng==0.20220715.0
76+
# via qrcode
77+
python-dateutil==2.9.0.post0
78+
# via arrow
79+
python-dotenv==1.0.1
80+
# via uvicorn
81+
python-slugify==8.0.4
82+
# via cookiecutter
83+
pyyaml==6.0.2
84+
# via cookiecutter
85+
# via uvicorn
86+
qrcode==7.4.2
87+
# via flet
88+
repath==0.9.0
89+
# via flet-core
90+
requests==2.32.3
91+
# via cookiecutter
92+
rich==13.9.4
93+
# via cookiecutter
94+
six==1.16.0
95+
# via python-dateutil
96+
# via repath
97+
sniffio==1.3.1
98+
# via anyio
99+
# via httpx
100+
starlette==0.41.2
101+
# via fastapi
102+
text-unidecode==1.3
103+
# via python-slugify
104+
types-python-dateutil==2.9.0.20241003
105+
# via arrow
106+
typing-extensions==4.12.2
107+
# via fastapi
108+
# via pydantic
109+
# via pydantic-core
110+
# via qrcode
111+
urllib3==2.2.3
112+
# via requests
113+
uvicorn==0.32.0
114+
# via flet
115+
uvloop==0.21.0
116+
# via uvicorn
117+
watchdog==4.0.2
118+
# via flet
119+
watchfiles==0.24.0
120+
# via uvicorn
121+
websockets==13.1
122+
# via uvicorn
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# generated by rye
2+
# use `rye lock` or `rye sync` to update this lockfile
3+
#
4+
# last locked with the following flags:
5+
# pre: false
6+
# features: []
7+
# all-features: false
8+
# with-sources: false
9+
# generate-hashes: false
10+
# universal: false
11+
12+
-e file:.
13+
annotated-types==0.7.0
14+
# via pydantic
15+
anyio==4.6.2.post1
16+
# via httpx
17+
# via starlette
18+
# via watchfiles
19+
arrow==1.3.0
20+
# via cookiecutter
21+
binaryornot==0.4.4
22+
# via cookiecutter
23+
certifi==2024.8.30
24+
# via httpcore
25+
# via httpx
26+
# via requests
27+
chardet==5.2.0
28+
# via binaryornot
29+
charset-normalizer==3.4.0
30+
# via requests
31+
click==8.1.7
32+
# via cookiecutter
33+
# via uvicorn
34+
cookiecutter==2.6.0
35+
# via flet
36+
fastapi==0.115.4
37+
# via flet
38+
flet==0.24.1
39+
# via flet-template
40+
flet-core==0.24.1
41+
# via flet-runtime
42+
flet-runtime==0.24.1
43+
# via flet
44+
h11==0.14.0
45+
# via httpcore
46+
# via uvicorn
47+
httpcore==1.0.6
48+
# via httpx
49+
httptools==0.6.4
50+
# via uvicorn
51+
httpx==0.27.2
52+
# via flet-runtime
53+
idna==3.10
54+
# via anyio
55+
# via httpx
56+
# via requests
57+
jinja2==3.1.4
58+
# via cookiecutter
59+
markdown-it-py==3.0.0
60+
# via rich
61+
markupsafe==3.0.2
62+
# via jinja2
63+
mdurl==0.1.2
64+
# via markdown-it-py
65+
oauthlib==3.2.2
66+
# via flet-runtime
67+
packaging==23.2
68+
# via flet
69+
pydantic==2.9.2
70+
# via fastapi
71+
pydantic-core==2.23.4
72+
# via pydantic
73+
pygments==2.18.0
74+
# via rich
75+
pypng==0.20220715.0
76+
# via qrcode
77+
python-dateutil==2.9.0.post0
78+
# via arrow
79+
python-dotenv==1.0.1
80+
# via uvicorn
81+
python-slugify==8.0.4
82+
# via cookiecutter
83+
pyyaml==6.0.2
84+
# via cookiecutter
85+
# via uvicorn
86+
qrcode==7.4.2
87+
# via flet
88+
repath==0.9.0
89+
# via flet-core
90+
requests==2.32.3
91+
# via cookiecutter
92+
rich==13.9.4
93+
# via cookiecutter
94+
six==1.16.0
95+
# via python-dateutil
96+
# via repath
97+
sniffio==1.3.1
98+
# via anyio
99+
# via httpx
100+
starlette==0.41.2
101+
# via fastapi
102+
text-unidecode==1.3
103+
# via python-slugify
104+
types-python-dateutil==2.9.0.20241003
105+
# via arrow
106+
typing-extensions==4.12.2
107+
# via fastapi
108+
# via pydantic
109+
# via pydantic-core
110+
# via qrcode
111+
urllib3==2.2.3
112+
# via requests
113+
uvicorn==0.32.0
114+
# via flet
115+
uvloop==0.21.0
116+
# via uvicorn
117+
watchdog==4.0.2
118+
# via flet
119+
watchfiles==0.24.0
120+
# via uvicorn
121+
websockets==13.1
122+
# via uvicorn
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def hello() -> str:
2+
return "Hello from flet-template!"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import flet
2+
from flet import IconButton, Page, Row, TextField, icons
3+
4+
5+
def main(page: Page):
6+
page.title = "Flet counter example"
7+
page.vertical_alignment = "center"
8+
9+
txt_number = TextField(value="0", text_align="right", width=100)
10+
11+
def minus_click(e):
12+
txt_number.value = str(int(txt_number.value) - 1)
13+
page.update()
14+
15+
def plus_click(e):
16+
txt_number.value = str(int(txt_number.value) + 1)
17+
page.update()
18+
19+
page.add(
20+
Row(
21+
[
22+
IconButton(icons.REMOVE, on_click=minus_click),
23+
txt_number,
24+
IconButton(icons.ADD, on_click=plus_click),
25+
],
26+
alignment="center",
27+
)
28+
)
29+
30+
31+
flet.app(target=main)

0 commit comments

Comments
 (0)