-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
60 lines (54 loc) · 1.7 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
.PHONY: default wheel dev convert-rst resize update-doc docs prepare-release release publish-no-test publish test
# shell option to use extended glob from from https://stackoverflow.com/a/6922447/1560241
SHELL:=/bin/bash -O extglob
VERSION=`< VERSION`
author=$(Ge Yang)
author_email=$([email protected])
# notes on python packaging: http://python-packaging.readthedocs.io/en/latest/minimal.html
default: publish prepare-release release
wheel:
rm -rf dist
python setup.py bdist_wheel
dev:
make wheel
pip install --ignore-installed dist/zaku*.whl
convert-rst:
pandoc -s README.md -o README --to=rst
sed -i '' 's/code/code-block/g' README
sed -i '' 's/\.\. code-block:: log/.. code-block:: text/g' README
sed -i '' 's/\.\//https\:\/\/github\.com\/geyang\/zaku\/blob\/master\//g' README
perl -p -i -e 's/\.(jpg|png|gif)/.$$1?raw=true/' README
rst-lint README
resize: # from https://stackoverflow.com/a/28221795/1560241
echo ./figures/!(*resized).jpg
convert ./figures/!(*resized).jpg -resize 888x1000 -set filename:f '%t' ./figures/'%[filename:f]_resized.jpg'
update-doc: convert-rst
python setup.py sdist upload
preview:
sphinx-autobuild docs docs/_build/html
docs:
rm -rf docs/_build
cd docs && make html
cd docs/_build/html && python -m http.server 8888
prepare:
-git tag -d v$(VERSION)
-git push --delete v$(VERSION) &
-git tag -d latest
-git push --delete latest
release: prepare
git push
git tag v$(VERSION) -m '$(msg)'
git tag latest
git push origin --tags -f
publish-no-test: convert-rst
make wheel
twine upload dist/*
publish: convert-rst
make test
make wheel
twine upload dist/*
test:
pwd && \
python -m pytest specs --capture=no
prod:
conda activate torch && uvicorn zaku.server:get_app