-
Notifications
You must be signed in to change notification settings - Fork 0
/
agent.py
44 lines (36 loc) · 1.1 KB
/
agent.py
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
from pyouter.app import App
from pyouter.router import Router
from agent.fun_doc import FuncDocAgent
from pyeff.shell import run_cmds
from pyeff.fs import current_dir
if __name__ == "__main__":
"""
pip install -r requirements-dev.txt
python agent.func.doc --token=...
python agent.test
python agent.publish
TODO: chain agent.comment and agent.test
"""
dir = current_dir(__file__)
config = {}
app = App(config=config)
app.option("--token", dest="token", nargs="?", type=str, help="debug")
app.use(
router=Router(
agent=Router(
func=Router(
doc=FuncDocAgent(),
),
test=lambda config, options: run_cmds(
[f"pip install {dir}", "cd src/tests && python test.py"]
),
publish=lambda config, options: run_cmds(
[
"python setup.py bdist_wheel --universal",
"twine upload dist/* --verbos",
]
),
)
)
)
app.run()