File: rules

package info (click to toggle)
python-django-formtools 2.5.1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 1,060 kB
  • sloc: python: 2,092; makefile: 187; sh: 4
file content (35 lines) | stat: -rwxr-xr-x 1,351 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
32
33
34
35
#!/usr/bin/make -f

UPSTREAM_GIT := https://github.com/django/django-formtools.git
include /usr/share/openstack-pkg-tools/pkgos.make

export SETUPTOOLS_SCM_PRETEND_VERSION=$(shell dpkg-parsechangelog -SVersion | sed -e 's/^[[:digit:]]*://' -e 's/[-].*//' -e 's/~git.*//' -e 's/~/.0/' -e 's/+dfsg1//' -e 's/+ds1//' | head -n 1)

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

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

#override_dh_auto_install:
#	python3 -m build --sdist --outdir=dist/
#	python3 -m installer --destdir=$(CURDIR)/debian/python3-django-formtools dist/*.tar.gz

override_dh_auto_test:
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
	set -e ; set -x ; for pyvers in $(PYTHON3S); do \
		PYMAJOR=`echo $$pyvers | cut -d'.' -f1` ; \
		echo "===> Testing with python$$pyvers (python$$PYMAJOR)" ; \
		LIBDIR_END=$$PYMAJOR ; \
		PYTHONPATH=. DJANGO_SETTINGS_MODULE=tests.settings PYTHON=python$${pyvers} python$${pyvers} -m coverage run /usr/bin/django-admin test tests ; \
	done
endif


override_dh_sphinxdoc:
ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
	PYTHONPATH=. python3 -m sphinx -b html docs debian/python-django-formtools-doc/usr/share/doc/python-django-formtools-doc/html
	dh_sphinxdoc
endif