forked from stacked-git/stgit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
126 lines (96 loc) · 2.49 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
prefix ?= $(HOME)/.local
DESTDIR ?= /
PYTHON ?= python3
DEFAULT_TEST_TARGET ?= test
STG_PROVE_OPTS ?=
export DESTDIR PYTHON
TEST_PATCHES ?= ..
all: build
build:
$(PYTHON) setup.py build
dist:
$(PYTHON) setup.py sdist
install:
$(PYTHON) setup.py install --prefix=$(prefix) --root=$(DESTDIR) --force
.PHONY: all build dist install
doc:
$(MAKE) -C Documentation all
install-doc:
$(MAKE) -C Documentation install
install-html:
$(MAKE) -C Documentation install-html
.PHONY: doc install-doc install-html
lint: lint-black lint-isort lint-flake8 lint-t
lint-black:
$(PYTHON) -m black --check --quiet --diff . stg
lint-isort:
$(PYTHON) -m isort --check-only --quiet . stg
lint-flake8:
$(PYTHON) -m flake8 . stg
lint-t:
$(MAKE) -C t test-lint
.PHONY: lint lint-black lint-isort lint-flake8 lint-t
format:
$(PYTHON) -m black . stg
$(PYTHON) -m isort --quiet . stg
test: build
$(MAKE) -C t all
test-patches:
for patch in $$(stg series --noprefix $(TEST_PATCHES)); do \
stg goto $$patch && $(MAKE) test || break; \
done
.PHONY: format test test-patches
coverage:
$(MAKE) coverage-test
$(MAKE) coverage-report
coverage-test:
rm -f .coverage
$(MAKE) .coverage
.coverage:
rm -rf build
-mkdir .cov-files
COVERAGE_FILE=$(CURDIR)/.cov-files/.coverage \
$(PYTHON) -m coverage run --context=setup setup.py build
COVERAGE_PROCESS_START=$(CURDIR)/pyproject.toml \
COVERAGE_FILE=$(CURDIR)/.cov-files/.coverage \
$(MAKE) -C t all
COVERAGE_PROCESS_START=$(CURDIR)/pyproject.toml \
COVERAGE_FILE=$(CURDIR)/.cov-files/.coverage \
$(MAKE) -C Documentation build-txt
$(PYTHON) -m coverage combine .cov-files/.coverage.*
rm -r .cov-files
coverage-report: .coverage
$(PYTHON) -m coverage html
$(PYTHON) -m coverage report
@echo "HTML coverage report: file://$(CURDIR)/htmlcov/index.html"
.PHONY: coverage coverage-test coverage-report
clean:
for dir in Documentation t; do \
$(MAKE) -C $$dir clean; \
done
rm -rf build
rm -rf dist
rm -f stgit/*.pyc
rm -rf stgit/__pycache__
rm -f stgit/builtin_version.py
rm -f stgit/commands/*.pyc
rm -rf stgit/commands/__pycache__
rm -f stgit/commands/cmdlist.py
rm -f stgit/completion/*.pyc
rm -rf stgit/completion/__pycache__
rm -f stgit/lib/*.pyc
rm -rf stgit/lib/__pycache__
rm -f stgit/lib/git/*.pyc
rm -rf stgit/lib/git/__pycache__
rm -f TAGS tags
rm -f MANIFEST
rm -f completion/stg.fish
rm -f completion/stgit.bash
rm -f .coverage
rm -rf .cov-files
rm -rf htmlcov
tags:
ctags -R stgit/*
TAGS:
ctags -e -R stgit/*
.PHONY: clean tags TAGS