forked from photoshell/rawkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
73 lines (55 loc) · 1.54 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
REBUILD_FLAG =
VENV=env
BIN=$(VENV)/bin
ACTIVATE=source $(BIN)/activate
APIDOCS=docs/source/api
DOCSRC=$(APIDOCS)/modules.rst docs/source/* docs/source/_static/*
.PHONY: all
all: test build pre-commit
.PHONY: pre-commit
pre-commit: .git/hooks/pre-commit
.git/hooks/pre-commit: .pre-commit-config.yaml $(VENV)
$(ACTIVATE); pre-commit install
$(VENV): $(VENV)/bin/activate
$(VENV)/bin/activate: requirements-dev.txt
test -d $(VENV) || virtualenv -p /usr/bin/python3 $(VENV)
$(ACTIVATE); pip install -r requirements-dev.txt
touch $(BIN)/activate
.PHONY: test
test: $(VENV)
$(ACTIVATE); tox $(REBUILD_FLAG)
.PHONY: stress-test
stress-test: $(VENV)
$(ACTIVATE); INPUT=$(INPUT) tox -c tox-stress.ini $(REBUILD_FLAG)
dist/*.whl: setup.py rawkit/*.py
python setup.py bdist_wheel
dist/*.tar.gz: setup.py rawkit/*.py
python setup.py sdist bdist
.PHONY: wheel
wheel: dist/*.whl
.PHONY: dist
dist: dist/*.tar.gz
.PHONY: build
build: pre-commit wheel dist
.PHONY: upload
upload: clean
python setup.py sdist bdist bdist_wheel upload
.PHONY: clean
clean:
-$(ACTIVATE) 2>/dev/null; $(MAKE) -C docs $@
find . -iname '*.pyc' | xargs rm -f
find . -iname '__pycache__' -type d | xargs rm -rf
rm -rf .tox
rm -rf build
rm -rf dist
rm -rf $(VENV)
.PHONY: docs
docs: epub html $(VENV)
.PHONY: html
html: $(DOCSRC) $(VENV)
$(ACTIVATE); $(MAKE) -C docs $@
.PHONY: epub
epub: $(DOCSRC) $(VENV)
$(ACTIVATE); $(MAKE) -C docs $@
$(APIDOCS)/modules.rst: rawkit/*.py libraw/*.py $(VENV)
$(ACTIVATE); sphinx-apidoc -f -E -M -o $(APIDOCS) -H Contents . docs tests setup.py