-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
77 lines (56 loc) · 1.84 KB
/
Makefile
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
# With credit to Sierra Moxon: https://github.com/geneontology/go-fastapi/blob/main/Makefile
MAKEFLAGS += --warn-undefined-variables
SHELL := bash
.SHELLFLAGS := -eu -o pipefail -c
.DEFAULT_GOAL := help
ENV_VARS := $$(cat .env | sed 's/\#.*//g' | xargs)
help:
@echo ""
@echo "make help -- show this help"
@echo "BASIC"
@echo " make install-dev -- install dependencies"
@echo " make test-basic -- run basic tests"
@echo " make example-cli-monarch -- run example CLI script"
@echo "PUBLISHING"
@echo " make docs -- build documentation"
@echo " make pypi-publish-test -- publish to test PyPI"
@echo " make pypi-publish -- publish to PyPI"
@echo "WEBAPP"
@echo " make example-streamlit -- run webapp in dev mode"
@echo "BASH AGENT"
@echo " make bash-ai-alias -- print alias for bash agent"
@echo ""
build: install-dev docs
#### Basic ####
install-dev:
poetry install
# TODO: tests for different utilities (main class, bash agent, web ui)
test-basic:
# --capture=no to see stdout in logs for successful tests
poetry run pytest --capture=no -v tests
example-cli-monarch:
poetry run python3 examples/monarch_cli.py
##### Publishing #####
.PHONY: docs
docs:
poetry run $(MAKE) -C docs html
pypi-publish-test:
rm -r dist/*
poetry export -f requirements.txt --output requirements.txt
poetry build
twine upload -r testpypi dist/*
pypi-publish:
rm -r dist/*
poetry export -f requirements.txt --output requirements.txt
poetry build
# set TWINE_USERNAME=__token__
# set TWINE_PASSWORD=<token>
# in .env for twine to use for the upload to pypi
env $(ENV_VARS) twine upload dist/*
##### Webapp #####
example-streamlit:
poetry run streamlit run examples/streamlit_app.py
##### Bash Agent #####
bash-ai-alias:
@echo "# source <(make bash-ai-alias) && ai --help"
@echo alias ai=\'poetry run python3 src/agent_smith_ai/bash_agent/main.py\'