-
Notifications
You must be signed in to change notification settings - Fork 928
/
Copy pathpoe_tasks.toml
55 lines (54 loc) · 2.24 KB
/
poe_tasks.toml
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
[tasks]
format = "ruff format"
lint = "ruff check"
typecheck = "pytype --config pytype.toml"
validate-sql = "sqlvalidator --verbose-validate agents_api/"
check = [
"lint",
"format",
"validate-sql",
"typecheck",
]
codegen_openapi = """
datamodel-codegen \
--input ../openapi.yaml \
--input-file-type openapi \
--output agents_api/autogen/ \
--output-model-type pydantic_v2.BaseModel \
--strict-types bool \
--strict-nullable \
--allow-population-by-field-name \
--field-include-all-keys \
--reuse-model \
--snake-case-field \
--enum-field-as-literal all \
--field-constraints \
--use-operation-id-as-name \
--use-schema-description \
--use-field-description \
--use-annotated \
--use-default \
--use-unique-items-as-set \
--use-subclass-enum \
--use-union-operator \
--use-one-literal-as-default \
--use-double-quotes \
--use-exact-imports \
--use-standard-collections \
--use-non-positive-negative-number-constrained-types \
--target-python-version 3.12 \
--treat-dot-as-module \
--use-title-as-name \
--collapse-root-models \
--output-datetime-class AwareDatetime \
--openapi-scopes schemas \
--keep-model-order \
--disable-timestamp"""
fix_list_response = "python -c \"import base64; exec(base64.b64decode('CmltcG9ydCByZQoKZGVmIGZpeF9nZW5lcmljX2NsYXNzZXMoZmlsZV9wYXRoKToKICAgIHdpdGggb3BlbihmaWxlX3BhdGgsICdyJykgYXMgZmlsZToKICAgICAgICBjb250ZW50ID0gZmlsZS5yZWFkKCkKCiAgICAjIFJlZ3VsYXIgZXhwcmVzc2lvbiB0byBmaW5kIGluY29ycmVjdCBnZW5lcmljIGNsYXNzIGRlZmluaXRpb25zCiAgICBwYXR0ZXJuID0gcmUuY29tcGlsZShyJ2NsYXNzIChcdyspXFsoXHcrKTogQmFzZU1vZGVsXF1cKChCYXNlTW9kZWwpXCk6JykKICAgIHJlcGxhY2VtZW50ID0gcidjbGFzcyBcMShcMywgR2VuZXJpY1tcMl0pOicKCiAgICAjIFJlcGxhY2UgaW5jb3JyZWN0IGdlbmVyaWMgY2xhc3MgZGVmaW5pdGlvbnMKICAgIGZpeGVkX2NvbnRlbnQgPSByZS5zdWIocGF0dGVybiwgcmVwbGFjZW1lbnQsIGNvbnRlbnQpCgogICAgIyBXcml0ZSB0aGUgZml4ZWQgY29udGVudCBiYWNrIHRvIHRoZSBmaWxlCiAgICB3aXRoIG9wZW4oZmlsZV9wYXRoLCAndycpIGFzIGZpbGU6CiAgICAgICAgZmlsZS53cml0ZShmaXhlZF9jb250ZW50KQoKZml4X2dlbmVyaWNfY2xhc3NlcygnYWdlbnRzX2FwaS9hdXRvZ2VuL29wZW5hcGlfbW9kZWwucHknKQo=').decode())\""
codegen = [
"codegen_openapi",
"fix_list_response",
]
[tasks.test]
env = { AGENTS_API_TESTING = "true", PYTHONPATH = "{PYTHONPATH}:." }
cmd = "ward test --exclude .venv"