-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
82 lines (61 loc) · 1.69 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
77
78
79
80
81
.PHONY: docs web
github = https://github.com/voschezang/mash/blob/main/
out = docs/source/modules
test:
# print difference as a warning
autopep8 -r --diff .
flake8 --ignore=E241,E501,W504
pytest -n 4
format:
autopep8 -r -a -a -a --in-place .
clean:
find . -name '__pycache__' | xargs rm -rf {1}
#find . -name '__pycache__' -exec rm -rf {} \;
rm -rf dist
rm -rf src/*.egg-info
setup:
pip3 install -r requirements.txt
install:
python3 -m pip install .
build:
make clean
python3 -m build
upload-test:
make build
python3 -m twine upload --repository testpypi dist/* -u "${user}" -p "${pass}"
upload:
make build
python3 -m twine upload dist/* -u "${user}" -p "${pass}"
docs-init:
mkdir -p docs
cd docs && yes y | make sphinx-quickstart
make docs
docs:
make docs-generate
source env/bin/activate && cd docs && make html
docs-clean:
rm -rf docs/source/modules
rm -rf docs/build
docs-show:
open docs/build/html/index.html
docs-watch:
make docs-show
find docs/source -type f -name '*.rst' -o -name '*.md' -prune -o -name 'docs/source/modules/*.rst' | entr make docs
docs-generate:
# generate modules from python source code
cd docs && sphinx-apidoc -o source/modules ../src/mash
# generate shell help
python3 src/examples/shell_example.py -h > ${out}/shell_help.txt
# generate examples
echo '# Examples\n' > ${out}/mash_examples.md
find src/examples/*.py -type f -regex 'src/examples/[a-z][a-z_]*.py' -exec echo '- [{}](${github}{})' \; >> ${out}/mash_examples.md
pydocs:
cd src && pydoc -b
tree:
tree src -L 2 -d
tree src/mash -L 2 --gitignore -I '_*|*.out'
ast:
egrep -rh '^class \w+(\(\w+\))?\:' src/mash/shell/ast
web:
open web/home.html
python3 src/examples/server.py