-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.doql.less
More file actions
255 lines (218 loc) · 6.38 KB
/
Copy pathapp.doql.less
File metadata and controls
255 lines (218 loc) · 6.38 KB
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
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
// LESS format — define @variables here as needed
app {
name: wup;
version: 0.2.69;
}
dependencies {
runtime: "watchdog>=4.0.0, psutil>=5.9.0, rich>=13.0.0, typer>=0.9.0, pyyaml>=6.0";
dev: "pytest>=7.0.0, goal>=2.1.0, costs>=0.1.20, pfix>=0.1.60, uri2wup, dsl2wup, nlp2wup, cli2wup, mcp2wup, rest2wup, httpx>=0.27";
visual: "playwright>=1.40,<2";
}
entity[name="AdoptCommand"] {
verb: Literal[!;
root: string!;
out: string;
}
entity[name="EndpointsCommand"] {
verb: Literal[!;
scenarios_dir: string!;
out: string!;
testql_bin: string!;
}
entity[name="GenerateCommand"] {
verb: Literal[!;
text: string;
out: string;
project: string;
template: Optional[Literal[;
}
entity[name="HealthCommand"] {
verb: Literal[!;
service: string;
project: string;
}
entity[name="InitCommand"] {
verb: Literal[!;
project: string!;
out: string!;
}
entity[name="InitCliCommand"] {
verb: Literal[!;
project: string!;
out: string!;
scenarios: string!;
merge: bool!;
infer_args: bool!;
}
entity[name="MapCommand"] {
verb: Literal[!;
project: string!;
out: string!;
framework: string!;
}
entity[name="PatchCommand"] {
verb: Literal[!;
target: string!;
with_path: string!;
file: string;
project: string;
}
entity[name="QueryCommand"] {
verb: Literal[!;
target: string!;
file: string;
format: Literal[!;
project: string;
}
entity[name="ResolveCommand"] {
verb: Literal[!;
text: string!;
file: string;
project: string;
}
entity[name="StatusCommand"] {
verb: Literal[!;
project: string!;
deps_file: string!;
file: string;
delta_seconds: int!;
failed_only: bool!;
}
entity[name="SyncCommand"] {
verb: Literal[!;
project: string!;
file: string;
merge_endpoints: bool!;
}
entity[name="ValidateCommand"] {
verb: Literal[!;
path: string;
project: string;
}
interface[type="api"] {
type: rest;
framework: fastapi;
}
interface[type="cli"] {
framework: argparse;
}
interface[type="cli"] page[name="wup"] {
entry: wup.cli:app;
}
interface[type="web"] {
type: spa;
framework: static;
}
workflow[name="install"] {
trigger: manual;
step-1: run cmd=echo "📦 Installing sumd...";
step-2: run cmd=if command -v uv > /dev/null 2>&1; then \;
step-3: run cmd=uv pip install -e .; \;
step-4: run cmd=else \;
step-5: run cmd=pip install -e .; \;
step-6: run cmd=fi;
step-7: run cmd=echo "✅ Installation completed!";
}
workflow[name="install-dev"] {
trigger: manual;
step-1: run cmd=echo "📦 Installing sumd with dev dependencies...";
step-2: run cmd=if command -v uv > /dev/null 2>&1; then \;
step-3: run cmd=uv pip install -e ".[dev]"; \;
step-4: run cmd=else \;
step-5: run cmd=pip install -e ".[dev]"; \;
step-6: run cmd=fi;
step-7: run cmd=echo "✅ Dev installation completed!";
}
workflow[name="test"] {
trigger: manual;
step-1: run cmd=echo "🧪 Running tests...";
step-2: run cmd=.venv/bin/python -m pytest tests/ -v --tb=short;
}
workflow[name="test-cov"] {
trigger: manual;
step-1: run cmd=echo "🧪 Running tests with coverage...";
step-2: run cmd=.venv/bin/python -m pytest tests/ -v --cov=sumd --cov-report=term-missing --cov-report=json;
}
workflow[name="lint"] {
trigger: manual;
step-1: run cmd=echo "🔍 Running linting with ruff...";
step-2: run cmd=.venv/bin/python -m ruff check sumd/;
step-3: run cmd=.venv/bin/python -m ruff check tests/;
}
workflow[name="format"] {
trigger: manual;
step-1: run cmd=echo "📝 Formatting code with ruff...";
step-2: run cmd=.venv/bin/python -m ruff format sumd/;
step-3: run cmd=.venv/bin/python -m ruff format tests/;
}
workflow[name="clean"] {
trigger: manual;
step-1: run cmd=echo "🧹 Cleaning temporary files...";
step-2: run cmd=find . -type f -name "*.pyc" -delete;
step-3: run cmd=find . -type d -name "__pycache__" -delete;
step-4: run cmd=find . -type d -name "*.egg-info" -exec rm -rf {} + 2>/dev/null || true;
step-5: run cmd=rm -rf build/ dist/ .coverage htmlcov/ coverage.json;
step-6: run cmd=echo "✅ Clean completed!";
}
workflow[name="publish"] {
trigger: manual;
step-1: run cmd=echo "📦 Publishing to PyPI...";
step-2: run cmd=command -v .venv/bin/twine > /dev/null 2>&1 || (.venv/bin/pip install --upgrade twine build);
step-3: run cmd=rm -rf dist/ build/ *.egg-info/;
step-4: run cmd=.venv/bin/python -m build;
step-5: run cmd=.venv/bin/twine check dist/*;
step-6: run cmd=echo "⚡ Ready to upload.";
step-7: run cmd=.venv/bin/twine upload dist/*;
}
workflow[name="publish-test"] {
trigger: manual;
step-1: run cmd=echo "📦 Publishing to TestPyPI...";
step-2: run cmd=command -v .venv/bin/twine > /dev/null 2>&1 || (.venv/bin/pip install --upgrade twine build);
step-3: run cmd=rm -rf dist/ build/ *.egg-info/;
step-4: run cmd=.venv/bin/python -m build;
step-5: run cmd=.venv/bin/twine upload --repository testpypi dist/*;
}
workflow[name="version"] {
trigger: manual;
step-1: run cmd=echo "📦 Version information...";
step-2: run cmd=cat VERSION;
step-3: run cmd=.venv/bin/python -c "from importlib.metadata import version; print(f'Installed version: {version(\"sumd\")}')";
}
workflow[name="wup:watch"] {
trigger: manual;
step-1: run cmd=poetry run wup watch;
}
workflow[name="wup:status"] {
trigger: manual;
step-1: run cmd=poetry run wup status;
}
workflow[name="wup:sync"] {
trigger: manual;
step-1: run cmd=poetry run wup sync-testql . --write;
}
workflow[name="wup:endpoints"] {
trigger: manual;
step-1: run cmd=poetry run wup testql-endpoints;
}
workflow[name="wup:map"] {
trigger: manual;
step-1: run cmd=poetry run wup map-deps;
}
tests {
import: testql-scenarios/**/*.testql.toon.yaml;
}
env_vars {
keys: OPENROUTER_API_KEY, LLM_MODEL, PFIX_AUTO_APPLY, PFIX_AUTO_INSTALL_DEPS, PFIX_AUTO_RESTART, PFIX_MAX_RETRIES, PFIX_DRY_RUN, PFIX_ENABLED, PFIX_GIT_COMMIT, PFIX_GIT_PREFIX, PFIX_CREATE_BACKUPS;
}
deploy {
target: docker;
}
environment[name="local"] {
runtime: docker-compose;
env_file: .env;
template_file: .env.example;
python_version: >=3.10;
vars: LLM_MODEL, OPENROUTER_API_KEY, PFIX_AUTO_APPLY, PFIX_AUTO_INSTALL_DEPS, PFIX_AUTO_RESTART, PFIX_CREATE_BACKUPS, PFIX_DRY_RUN, PFIX_ENABLED, PFIX_GIT_COMMIT, PFIX_GIT_PREFIX, PFIX_MAX_RETRIES;
runtime_llm: OPENROUTER_API_KEY;
runtime_pfix: PFIX_AUTO_APPLY, PFIX_AUTO_INSTALL_DEPS, PFIX_AUTO_RESTART, PFIX_CREATE_BACKUPS, PFIX_DRY_RUN, PFIX_ENABLED, PFIX_GIT_COMMIT, PFIX_GIT_PREFIX, PFIX_MAX_RETRIES;
}