-
Notifications
You must be signed in to change notification settings - Fork 27
/
Makefile
61 lines (43 loc) · 1.66 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
.PHONY: check build-test-image test-in-container exec-test check-local check-code-style check-pylint check-bandit setup-ci
TEST_IMAGE_NAME := colin-test
TEST_TARGET = ./tests
check: build-test-image test-in-container
build-test-image:
docker build --network host --tag=$(TEST_IMAGE_NAME) -f ./Dockerfile.tests .
test-in-container: build-test-image test-in-container-now
test-in-container-now:
@# use it like this: `make test-in-container TEST_TARGET=./tests/integration/test_utils.py`
docker run --rm --privileged --security-opt label=disable \
--name=colin \
--cap-add SYS_ADMIN -ti \
-v /var/tmp/ \
-v $(CURDIR):/src \
$(TEST_IMAGE_NAME) \
make exec-test TEST_TARGET="$(TEST_TARGET)"
test-in-ci: test-in-container
exec-test:
PYTHONPATH=$(CURDIR) py.test-3 --cov=colin $(TEST_TARGET)
check-code-style: check-pylint check-bandit
check-pylint:
pylint colin || true
clean:
python3 setup.py clean
rm -rf build/* dist/*
git clean -fx
html:
make -f Makefile.docs html
sdist:
./setup.py sdist -d .
rpm: sdist
rpmbuild ./*.spec -bb --define "_sourcedir $(CURDIR)" --define "_specdir $(CURDIR)" --define "_buildir $(CURDIR)" --define "_srcrpmdir $(CURDIR)" --define "_rpmdir $(CURDIR)"
srpm: sdist
rpmbuild ./*.spec -bs --define "_sourcedir $(CURDIR)" --define "_specdir $(CURDIR)" --define "_buildir $(CURDIR)" --define "_srcrpmdir $(CURDIR)" --define "_rpmdir $(CURDIR)"
rpm-in-mock-f27: srpm
mock --rebuild -r fedora-27-x86_64 ./*.src.rpm
rpm-in-mock-el7: srpm
mock --rebuild -r epel-7-x86_64 ./*.src.rpm
install: uninstall clean
pip3 install --user .
uninstall:
pip3 show colin && pip3 uninstall -y colin || true
rm /usr/lib/python*/site-packages/colin\* -rf