3 | 3 |
BUILD_DATE = $(shell LC_ALL=C date -u "+%B %d, %Y" -d "$(LAST_CHANGE)")
|
4 | 4 |
SPHINXOPTS := -D html_last_updated_fmt="$(BUILD_DATE)"
|
5 | 5 |
|
6 | |
PYTHONS:=$(shell pyversions -vr)
|
7 | |
PYTHON3S:=$(shell py3versions -vr)
|
8 | |
|
9 | 6 |
UPSTREAM_GIT := https://github.com/openstack/osprofiler.git
|
10 | 7 |
include /usr/share/openstack-pkg-tools/pkgos.make
|
11 | |
|
12 | |
export OSLO_PACKAGE_VERSION=$(VERSION)
|
13 | 8 |
|
14 | 9 |
%:
|
15 | 10 |
dh $@ --buildsystem=python_distutils --with python2,python3,sphinxdoc
|
16 | 11 |
|
17 | |
override_dh_install:
|
18 | |
set -e && for pyvers in $(PYTHONS); do \
|
19 | |
python$$pyvers setup.py install --install-layout=deb \
|
20 | |
--root $(CURDIR)/debian/python-osprofiler; \
|
21 | |
done
|
22 | |
set -e && for pyvers in $(PYTHON3S); do \
|
23 | |
python$$pyvers setup.py install --install-layout=deb \
|
24 | |
--root $(CURDIR)/debian/python3-osprofiler; \
|
25 | |
done
|
26 | |
mv $(CURDIR)/debian/python-osprofiler/usr/bin/osprofiler $(CURDIR)/debian/python-osprofiler/usr/bin/python2-osprofiler
|
27 | |
mv $(CURDIR)/debian/python3-osprofiler/usr/bin/osprofiler $(CURDIR)/debian/python3-osprofiler/usr/bin/python3-osprofiler
|
28 | |
rm -rf $(CURDIR)/debian/python*-osprofiler/usr/lib/python*/dist-packages/*.pth
|
|
12 |
override_dh_auto_install:
|
|
13 |
pkgos-dh_auto_install
|
29 | 14 |
|
30 | 15 |
override_dh_python3:
|
31 | 16 |
dh_python3 --shebang=/usr/bin/python3
|
32 | 17 |
|
33 | 18 |
override_dh_auto_test:
|
34 | 19 |
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
|
35 | |
echo "===> Running tests"
|
36 | |
set -ex ; for i in 2.7 $(PYTHON3S) ; do \
|
37 | |
PYMAJOR=`echo $$i | cut -d'.' -f1` ; \
|
38 | |
echo "===> Testing with python$$i (python$$PYMAJOR)" ; \
|
39 | |
rm -rf .testrepository ; \
|
40 | |
testr-python$$PYMAJOR init ; \
|
41 | |
TEMP_REZ=`mktemp -t` ; \
|
42 | |
PYTHONPATH=$(CURDIR) PYTHON=python$$i testr-python$$PYMAJOR run --subunit 'tests\.(?!.*OptsTestCase.test_entry_point.*)' | tee $$TEMP_REZ | subunit2pyunit ; \
|
43 | |
cat $$TEMP_REZ | subunit-filter -s --no-passthrough | subunit-stats ; \
|
44 | |
rm -f $$TEMP_REZ ; \
|
45 | |
testr-python$$PYMAJOR slowest ; \
|
46 | |
done
|
|
20 |
pkgos-dh_auto_test 'osprofiler\.tests\.(?!.*OptsTestCase.test_entry_point.*)'
|
47 | 21 |
endif
|
48 | 22 |
|
49 | 23 |
override_dh_clean:
|