File: Makefile

package info (click to toggle)
python-dlt 2.18.10.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 452 kB
  • sloc: python: 3,449; makefile: 55
file content (47 lines) | stat: -rw-r--r-- 1,225 bytes parent folder | download | duplicates (2)
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
# Non released dlt-daemon version based on 2.18.10
LIBDLT_VERSION=v2.18.10

IMAGE=python-dlt/python-dlt-unittest
TAG?=latest
DK_CMD=docker run --rm -v $(shell pwd):/pydlt -w /pydlt
TEST_ARGS?="-e py3,lint"

.PHONY: all
all:
	@echo "python-dlt testing commands, libdlt version: ${LIBDLT_VERSION}"
	@echo "  make unit-test       -- Run unit tests with tox (Run 'make build-image' the first time)"
	@echo "  make build-image     -- Build docker image for the usage of 'make unit-test'"
	@echo "  make clean           -- Remove all temporary files"

.PHONY: unit-test
unit-test:
	${DK_CMD} ${IMAGE}:${TAG} tox ${TEST_ARGS}

.PHONY: lint
lint:
	${DK_CMD} ${IMAGE}:${TAG} tox -e lint

.PHONY: build-image
build-image:
	docker build --build-arg LIBDLT_VERSION=${LIBDLT_VERSION} \
		--tag ${IMAGE}:${TAG} .
	docker build --build-arg LIBDLT_VERSION=${LIBDLT_VERSION} \
		--tag ${IMAGE}:${LIBDLT_VERSION} .

.PHONY: bash
bash:
	${DK_CMD} -it ${IMAGE}:${TAG}

.PHONY: clean
clean:
ifeq (,$(wildcard /.dockerenv))
	${DK_CMD} ${IMAGE}:${TAG} make clean
else
	find . -name "__pycache__" | xargs -n1 rm -rf
	find . -name "*.pyc" | xargs -n1 rm -rf
	rm -rf .coverage
	rm -rf *.egg-info
	rm -rf .eggs
	rm -rf junit_reports
	rm -rf .tox
endif