/
Taskfile.yml
232 lines (194 loc) · 5.04 KB
/
Taskfile.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
version: "3"
#
# global vars: https://taskfile.dev/#/usage?id=variables
#
vars:
VAR1: "some-var"
# global env:
env:
ENV1: testing
################################################################################################
tasks:
run:
aliases: [ 'r' ]
cmds:
- python3 src/try_nicegui/run06_tpl_spa.py
pack:
cmds:
- rm -rf dist/
- poetry run python build3.py
ignore_error: true
pack2:
aliases: [ 'p2' ]
cmds:
- rm -rf /tmp/dist/
# - poetry run python -m nuitka --onefile src/try_nicegui/run07_spa.py --static-libpython=no
- poetry run python -m nuitka --onefile src/try_nicegui/run07_spa.py --macos-create-app-bundle --static-libpython=no
i:
cmds:
- env PYTHON_CONFIGURE_OPTS="--enable-shared"; pyenv install 3.10.9
run7:
aliases: [ 'r7' ]
cmds:
- python3 src/try_nicegui/run07_spa.py
run2:
aliases: [ 'r2' ]
cmds:
- python src/try_nicegui/run02_tpl.py --mode=native
run6:
aliases: [ 'r6' ]
cmds:
- python3 src/try_nicegui/run06_tpl_spa.py
run5:
aliases: [ 'r5' ]
cmds:
- python3 src/try_nicegui/run05_tpl.py
run4:
aliases: [ 'r4' ]
cmds:
- python3 src/try_nicegui/run04_tpl.py
run3:
cmds:
- python3 src/try_nicegui/run03_exe.py
run:tray:
cmds:
- |
python src/try_nicegui/run01_tray.py
run:exe:
cmds:
- ./dist/myapp
cc:
cmds:
- task: c
- rm -rf build/
ignore_error: true
clean:
aliases: [ 'c' ]
cmds:
- rm -rf dist/
- rm -rf dist/
# - rm -rf build/
# - rm -rf .venv/
# - poetry env remove --all
ignore_error: true
exec4:
aliases: [ 'e4' ]
cmds:
# - ./dist/myapp/myapp
- ./dist/myapp
kill:
aliases: [ 'k' ]
cmds:
- killall myapp -9
- sudo kill -s HUP 1 # kill all zombie process
# FIXME: mem leak!!! zombie process!!!
rel4:
cmds:
- poetry run python build3.py
- open ./dist
- open ./build
ignore_error: true
rel3:
cmds:
# - poetry run python build2.py bdist_msi # build Windows installer
- poetry run python build2.py bdist_dmg # build macos installer
- open ./build
- open ./dist
ignore_error: true
rel2:
cmds:
- |
poetry run cxfreeze -c src/try_nicegui/run05_tpl.py \
--target-name myapp \
--target-dir dist
- open ./dist
release:
cmds:
# - poetry run pyinstaller -F -w -i ./public/images/logo.ico \
# src/try_nicegui/run02_tpl.py \
# --name myapp
# - cp poetry.toml poetry.bak.toml
# - cp poetry.rel.toml poetry.toml
- poetry install --directory=.
- poetry run python build.py
# - cp poetry.bak.toml poetry.toml
- open ./dist
################################################################################################
debug:
cmds:
# - poetry shell -vvv
- poetry debug info
- poetry env list
env:fix:
cmds:
# - rm -rf ~/Library/Caches/pypoetry # 也不要乱删此路径
- poetry env list
- poetry env remove --all
- poetry config virtualenvs.path --unset # 不要改此参数
env:init:
cmds:
- pyenv which python3
- poetry env use $(pyenv which python3)
- task: debug
# - poetry env use $(pyenv which python3)
# - poetry env use /Users/dev/.pyenv/versions/py310-exe/bin/python3
# - poetry env use 3.10
ignore_error: true
env:cfg:
cmds:
- poetry config virtualenvs.in-project false
- poetry config virtualenvs.create false
- poetry config virtualenvs.prefer-active-python true
- poetry config virtualenvs.path .venv
- poetry config --list
install:
cmds:
# - poetry config virtualenvs.in-project true
# - poetry config virtualenvs.create true
# - poetry config virtualenvs.prefer-active-python true
# - poetry config virtualenvs.path .venv
- poetry install -vvv
# - poetry run pip3 uninstall numpy
# - poetry run pip3 install numpy
ignore_error: true
poetry:
aliases: [ 'p' ]
cmds:
- poetry
- poetry {{.CLI_ARGS}}
add:
aliases: [ 'a' ]
cmds:
- poetry add {{.CLI_ARGS}}
add:list:
cmds:
#- poetry remove nicegui
- |
poetry add "typer[all]" \
nicegui pystray \
loguru Pillow pywebview
- |
poetry run \
pip3 install numpy # fix for m1 mac
add:dev:
cmds:
- |
poetry add --dev \
black pytest \
pyinstaller \
cx_Freeze
update:
aliases: [ 'u' ]
cmds:
- poetry update {{.CLI_ARGS}}
config:
cmds:
- poetry config virtualenvs.in-project false --local
- poetry config virtualenvs.create false --local
env:
cmds:
- poetry
- poetry env list
- poetry cache list
- poetry debug info
- poetry debug resolve