File: rules

package info (click to toggle)
python-formencode 2.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,844 kB
  • sloc: python: 7,032; makefile: 139; sh: 96; javascript: 61
file content (26 lines) | stat: -rwxr-xr-x 1,115 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
#! /usr/bin/make -f
export PYBUILD_NAME=formencode
export DH_ALWAYS_EXCLUDE=tests

# We need to have extra data files and the i18n files in place
# for the tests, but pybuild.testfiles doesn't preserve the directory
# structure we need - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=947800
# So we kludge around it here
define PYBUILD_BEFORE_TEST
	cp {dir}/formencode/tests/non_empty.txt {build_dir}/formencode/tests/
	cp -r {dir}/formencode/tests/htmlfill_data {build_dir}/formencode/tests/
	cp -r {dir}/formencode/i18n {build_dir}/formencode/
endef
export PYBUILD_BEFORE_TEST

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

override_dh_auto_install:
	dh_auto_install --buildsystem=pybuild
	dh_install -X.po -X.py -ppython3-formencode formencode/i18n/* /usr/share/locale/
	find debian/python3-formencode/ -type d \( -name i18n -or -name docs \) -print0 | xargs --null --no-run-if-empty rm -rf

override_dh_auto_test:
	# network is required for the http://this.domain.does.not.exist.example.org/test.html test
	LC_ALL=C.UTF-8 LANGUAGE=C.UTF-8 http_proxy='' dh_auto_test --buildsystem=pybuild -- --test-pytest