Make all StackTransaction arguments required
[stgit.git] / Makefile
blob9d86b0ccf766cbbb5c5b933dd9c97d43cd810250
1 prefix ?= $(HOME)/.local
2 DESTDIR ?= /
3 PYTHON ?= python3
4 DEFAULT_TEST_TARGET ?= test
5 STG_PROVE_OPTS ?=
7 export DESTDIR PYTHON
9 TEST_PATCHES ?= ..
11 all: build
13 build:
14 $(PYTHON) setup.py build
16 dist:
17 $(PYTHON) setup.py sdist
19 install:
20 $(PYTHON) setup.py install --prefix=$(prefix) --root=$(DESTDIR) --force
22 .PHONY: all build dist install
24 doc:
25 $(MAKE) -C Documentation all
27 install-doc:
28 $(MAKE) -C Documentation install
30 install-html:
31 $(MAKE) -C Documentation install-html
33 .PHONY: doc install-doc install-html
35 lint: lint-black lint-isort lint-flake8 lint-t
37 lint-black:
38 $(PYTHON) -m black --check --quiet --diff .
40 lint-isort:
41 $(PYTHON) -m isort --check-only --quiet --diff .
43 lint-flake8:
44 $(PYTHON) -m flake8 .
46 lint-t:
47 $(MAKE) -C t test-lint
49 .PHONY: lint lint-black lint-isort lint-flake8 lint-t
51 format:
52 $(PYTHON) -m black .
53 $(PYTHON) -m isort --quiet .
55 test: build
56 $(MAKE) -C t all
58 test-patches:
59 for patch in $$($(PYTHON) -m stgit.main series --noprefix $(TEST_PATCHES)); do \
60 $(PYTHON) -m stgit.main goto $$patch && $(MAKE) test || break; \
61 done
63 .PHONY: format test test-patches
65 coverage:
66 $(MAKE) coverage-test
67 $(MAKE) coverage-report
69 coverage-test:
70 rm -f .coverage
71 $(MAKE) .coverage
73 .coverage:
74 rm -rf build
75 -mkdir .cov-files
76 COVERAGE_RCFILE=$(CURDIR)/pyproject.toml \
77 COVERAGE_FILE=$(CURDIR)/.cov-files/.coverage \
78 $(PYTHON) -m coverage run --context=setup setup.py build
79 COVERAGE_RCFILE=$(CURDIR)/pyproject.toml \
80 COVERAGE_FILE=$(CURDIR)/.cov-files/.coverage \
81 $(MAKE) -C t all
82 COVERAGE_PROCESS_START=$(CURDIR)/pyproject.toml \
83 COVERAGE_RCFILE=$(CURDIR)/pyproject.toml \
84 COVERAGE_FILE=$(CURDIR)/.cov-files/.coverage \
85 $(MAKE) -C Documentation build-txt man
86 $(PYTHON) -m coverage combine .cov-files/.coverage.*
87 rm -r .cov-files
89 coverage-report: .coverage
90 $(PYTHON) -m coverage html
91 $(PYTHON) -m coverage report
92 @echo "HTML coverage report: file://$(CURDIR)/htmlcov/index.html"
94 .PHONY: coverage coverage-test coverage-report
96 dev-env:
97 $(PYTHON) -m pip install -U pip setuptools wheel
98 $(PYTHON) -m pip install coverage[toml] black flake8 flake8-bugbear isort
99 .PHONY: dev-env
101 clean:
102 for dir in Documentation t; do \
103 $(MAKE) -C $$dir clean; \
104 done
105 rm -rf build
106 rm -rf dist
107 rm -f stgit/*.pyc
108 rm -rf stgit/__pycache__
109 rm -f stgit/builtin_version.py
110 rm -f stgit/commands/*.pyc
111 rm -rf stgit/commands/__pycache__
112 rm -f stgit/commands/cmdlist.py
113 rm -f stgit/completion/*.pyc
114 rm -rf stgit/completion/__pycache__
115 rm -f stgit/lib/*.pyc
116 rm -rf stgit/lib/__pycache__
117 rm -f stgit/lib/git/*.pyc
118 rm -rf stgit/lib/git/__pycache__
119 rm -f TAGS tags
120 rm -f MANIFEST
121 rm -f completion/stg.fish
122 rm -f completion/stgit.bash
123 rm -f .coverage
124 rm -rf .cov-files
125 rm -rf htmlcov
127 tags:
128 ctags -R stgit/*
130 TAGS:
131 ctags -e -R stgit/*
133 .PHONY: clean tags TAGS