forked from amphibian-dev/toad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
69 lines (49 loc) · 1.19 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
.PHONY: build test
SHELL = /bin/bash
PYTHON = python3
PIP = pip3
SUDO ?=
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = toad
DOCSDIR = docs
SOURCEDIR := $(DOCSDIR)/source
BUILDDIR := $(DOCSDIR)/build
ifeq ('$(shell type -P python3)','')
PYTHON = python
endif
ifeq ('$(shell type -P pip3)','')
PIP = pip
endif
install: build
$(SUDO) $(PIP) install -e .
uninstall:
cat files.txt | xargs rm -rf
test_deps:
$(SUDO) $(PIP) install -r requirements-test.txt
test: test_deps
$(eval TARGET := $(filter-out $@, $(MAKECMDGOALS)))
@if [ -z $(TARGET) ]; then \
$(PYTHON) -m pytest -x toad; \
else \
$(PYTHON) -m pytest -s toad/$(TARGET)_test.py; \
fi
build_deps:
$(SUDO) $(PIP) install -r requirements.txt
build: build_deps
$(PYTHON) setup.py build_ext --inplace
dist_deps:
$(SUDO) $(PIP) install -U -r requirements-dist.txt
dist: build dist_deps
$(SUDO) $(PYTHON) setup.py sdist
dist_wheel: build dist_deps
$(SUDO) $(PYTHON) setup.py bdist_wheel --universal
upload:
twine check dist/*
@twine upload dist/* -u $(TWINE_USER) -p $(TWINE_PASS)
clean:
@rm -rf build/ dist/ *.egg-info/
docs: build
@$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
%:
@: