-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
26 lines (20 loc) · 773 Bytes
/
Makefile
File metadata and controls
26 lines (20 loc) · 773 Bytes
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
PYTHON := $(shell which python3 || which python)
URL := "https://github.com/kerrigan29a/microdoc/blob/main/{path}\#L{line}"
SOURCES := $(wildcard microdoc/*.py)
.PHONY: all clean test release
all: test README.md
clean:
-rm -f README.md *.json
-rm -rf .mypy_cache
-find . -name '*.pyc' -delete
-find . -name '__pycache__' -delete
test:
$(PYTHON) -m unittest discover -v
README.md: README.md.in $(SOURCES)
cat README.md.in | $(PYTHON) tools/replace_vars.py > README.md
$(PYTHON) -m microdoc.py2doc $(SOURCES) | $(PYTHON) -m microdoc.doc2md -l 2 -u $(URL) >> README.md
release: all
VERSION=$$($(PYTHON) -c 'import microdoc; print(microdoc.__version__)') && \
git push origin main && \
git tag -a v$$VERSION -m "Release v$$VERSION" && \
git push origin --tags