File: rules

package info (click to toggle)
python-testtools 2.5.0-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,788 kB
  • sloc: python: 13,741; makefile: 132; sh: 1
file content (39 lines) | stat: -rwxr-xr-x 1,336 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
#!/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=pybuild --with python3,sphinxdoc

override_dh_auto_clean:
	rm -rf build
	find . -iname '*.pyc' -delete
	for i in $$(find . -type d -iname __pycache__) ; do rm -rf $$i ; done

override_dh_auto_build:
	echo "Do nothing..."

override_dh_auto_install:
	pkgos-dh_auto_install --no-py2
	# 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)))
	python3 -m sphinx -b html doc $(CURDIR)/debian/python-testtools-doc/usr/share/doc/python-testtools-doc/html
	dh_sphinxdoc
	# 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

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