File: rules

package info (click to toggle)
python-testtools 2.3.0-5
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,344 kB
  • sloc: python: 13,873; makefile: 126; sh: 2
file content (31 lines) | stat: -rwxr-xr-x 1,195 bytes parent folder | download
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
#!/usr/bin/make -f

UPSTREAM_GIT := https://github.com/testing-cabal/testtools.git
include /usr/share/openstack-pkg-tools/pkgos.make

export http_proxy=http://127.0.0.1:9
export https_proxy=http://127.0.0.1:9

%:
	dh $@ --buildsystem=python_distutils --with python2,python3,sphinxdoc

override_dh_auto_install:
	pkgos-dh_auto_install
	# Remove 2x compat file as it causes errors during byte compilation on installation.
	echo 'raise SyntaxError' > \
		$(CURDIR)/debian/python3-testtools/usr/lib/python3/dist-packages/testtools/_compat2x.py

override_dh_sphinxdoc:
ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
	sphinx-build -b html doc $(CURDIR)/debian/python-testtools-doc/usr/share/doc/python-testtools-doc/html
	dh_sphinxdoc -O--buildsystem=python_distutils
	# Remove empty git placeholder files that make lintian unhappy.
	rm -f $(CURDIR)/debian/python-testtools-doc/usr/share/doc/python-testtools-doc/html/_static/placeholder.txt
endif

ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
override_dh_auto_test:
	set -ex ; for pyvers in $(PYTHONS) $(PYTHON3S); do \
		PYTHONPATH=$(CURDIR) PYTHON=python$$pyvers python$$pyvers -m testtools.run testtools.tests.test_suite ; \
	done
endif