This repository was archived by the owner on Jun 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
79 lines (64 loc) · 2.36 KB
/
Makefile
File metadata and controls
79 lines (64 loc) · 2.36 KB
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
ifeq ($(origin .RECIPEPREFIX), undefined)
$(error This Make does not support .RECIPEPREFIX. Please use GNU Make 4.0 or later)
endif
.DELETE_ON_ERROR:
.ONESHELL:
.SHELLFLAGS := -eu -o pipefail -c
.SILENT:
MAKEFLAGS += --no-builtin-rules
MAKEFLAGS += --warn-undefined-variables
SHELL = bash
DEBUG = TOMATE_DEBUG=1
DOCKER_IMAGE = eliostvs/tomate
OBS_API_URL = https://api.opensuse.org:443/trigger/runservice
PLUGINPATH = $(CURDIR)/data/plugins
PYTHONPATH = PYTHONPATH=$(CURDIR)/tomate:$(PLUGINPATH)
VERSION = `cat .bumpversion.cfg | grep current_version | awk '{print $$3}'`
WORKDIR = /code
XDGPATH = XDG_DATA_HOME=$(CURDIR)/tests/data
ifeq ($(shell which xvfb-run 1> /dev/null && echo yes),yes)
ARGS = xvfb-run -a
else
ARGS ?=
endif
.PHONY: clean
clean:
find . \( -iname "__pycache__" \) -print0 | xargs -0 rm -rf
rm -rf .eggs *.egg-info/ .coverage build/ .cache .pytest_cache
.PHONY: mime
mime: clean
update-mime-database tests/data/mime
rm -rf tests/data/mime/{image,aliases,generic-icons,globs,globs2,icons,magic,subclasses,treemagic,types,version,XMLnamespaces}
.PHONY: format
ifeq ($(origin .RECIPEPREFIX), undefined)
$(error This Make does not support .RECIPEPREFIX. Please use GNU Make 4.0 or later)
endif
.PHONY: submodule
submodule:
git submodule init;
git submodule update;
.PHONY: format
format:
black data/plugins/ tests/
.PHONY: clean
clean:
find . \( -iname "*.pyc" -o -iname "__pycache__" -o -iname ".coverage" -o -iname ".cache" \) -print0 | xargs -0 rm -rf
.PHONY: test
test: clean
echo "$(DEBUG) $(XDGPATH) $(PYTHONPATH) $(ARGS) py.test $(PYTEST) --cov=$(PLUGINPATH)"
$(DEBUG) $(XDGPATH) $(PYTHONPATH) $(ARGS) py.test $(PYTEST) --cov=$(PLUGINPATH)
.PHONY: trigger-build
trigger-build:
curl -X POST -H "Authorization: Token $(TOKEN)" $(OBS_API_URL)
release-%:
git flow init -d
@grep -q '\[Unreleased\]' CHANGELOG.md || (echo 'Create the [Unreleased] section in the changelog first!' && exit 1)
bumpversion --verbose --commit $*
git flow release start $(VERSION)
GIT_MERGE_AUTOEDIT=no git flow release finish -m "Merge branch release/$(VERSION)" -T $(VERSION) $(VERSION) -p
.PHONY: docker-test
docker-test:
docker run --rm -v $(CURDIR):$(WORKDIR) --workdir $(WORKDIR) $(DOCKER_IMAGE)
.PHONY: docker-enter
docker-enter:
docker run --rm -v $(CURDIR):$(WORKDIR) --workdir $(WORKDIR) -it --entrypoint="bash" $(DOCKER_IMAGE)