-
Notifications
You must be signed in to change notification settings - Fork 129
/
Makefile
81 lines (59 loc) · 2.6 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
VERSION = $(shell egrep "^VERSION" setup.py | awk '{print $$3}')
VENV_DIR = tests/.venv
sdist: oz.spec.in
python3 setup.py sdist
oz.spec: sdist
signed-tarball: sdist
gpg --detach-sign --armor -o dist/oz-$(VERSION).tar.gz.sign dist/oz-$(VERSION).tar.gz
signed-rpm: oz.spec
rpmbuild -ba oz.spec --sign --define "_sourcedir `pwd`/dist"
rpm: oz.spec
rpmbuild -ba oz.spec --define "_sourcedir `pwd`/dist"
srpm: oz.spec
rpmbuild -bs oz.spec --define "_sourcedir `pwd`/dist"
deb:
debuild -i -uc -us -b
release: signed-rpm signed-tarball deb
man2html:
@for file in oz-install oz-customize oz-generate-icicle oz-cleanup-cache oz-examples; do \
echo "Generating $$file HTML page from man" ; \
groff -mandoc -mwww man/$$file.? -T html > man/$$file.html ; \
done
$(VENV_DIR):
@virtualenv --system-site-packages $(VENV_DIR)
@pip-python -E $(VENV_DIR) install pytest
@[[ "$$PWD" =~ \ |\' ]] && ( \
echo "Resolving potential problems where '$$PWD' contains spaces" ; \
for MATCH in $$(grep '^#!"/' $(VENV_DIR)/bin/* -l) ; do \
sed -i '1s|^#!".*/\([^/]*\)"|#!/usr/bin/env \1|' "$$MATCH" ; \
done ) || true
virtualenv: $(VENV_DIR)
unittests:
@[ -f $(VENV_DIR)/bin/activate ] && source $(VENV_DIR)/bin/activate ; python3 setup.py test
@(type deactivate 2>/dev/null | grep -q 'function') && deactivate || true
tests: unittests
container-unittests-fedora:
docker rm -f oz-tests-fedora
docker build -f Containerfile.tests.fedora -t oz-tests-fedora-image .
docker run --name oz-tests-fedora oz-tests-fedora-image
docker cp oz-tests-fedora:/oz/coverage.xml .
container-unittests-el8:
docker rm -f oz-tests-el8
docker build -f Containerfile.tests.el8 -t oz-tests-el8-image .
docker run --name oz-tests-el8 oz-tests-el8-image
container-unittests: container-unittests-fedora container-unittests-el8
test-coverage:
python-coverage run --source oz /usr/bin/py.test --verbose tests
python-coverage html
xdg-open htmlcov/index.html
pylint:
pylint oz oz-install oz-customize oz-cleanup-cache oz-generate-icicle
flake8:
flake8 oz oz-install oz-customize oz-cleanup-cache oz-generate-icicle
container-clean:
docker rm -f oz-tests-fedora
docker rm -f oz-tests-el8
docker image rm -f -i oz-tests-fedora-image oz-tests-el8-image
clean:
rm -rf MANIFEST build dist usr *~ oz.spec *.pyc oz/*~ oz/*.pyc examples/*~ oz/auto/*~ man/*~ docs/*~ man/*.html $(VENV_DIR) tests/tdl/*~ tests/factory/*~ tests/results.xml htmlcov
.PHONY: sdist oz.spec signed-tarball signed-rpm rpm srpm deb release man2html virtualenv unittests container-unittests-fedora container-unittests-el8 container-unittests tests test-coverage pylint clean container-clean