File: rules

package info (click to toggle)
pytest 3.10.1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 4,268 kB
  • sloc: python: 35,038; makefile: 169; sh: 28
file content (62 lines) | stat: -rwxr-xr-x 2,160 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/make -f
# -*- makefile -*-

export PYBUILD_NAME=pytest

export PYBUILD_BEFORE_TEST=mkdir -p {dir}/debian/tmp/test-working-directory
export PYBUILD_AFTER_TEST=rm -rf {dir}/debian/tmp/test-working-directory
export PYBUILD_TEST_ARGS=\
	cd {dir}/debian/tmp/test-working-directory && \
	{interpreter} -m pytest --lsof -rfsxX \
		--ignore={dir}/testing/freeze \
		--ignore={dir}/testing/test_entry_points.py \
		--ignore={dir}/testing/test_pdb.py \
		--ignore={dir}/testing/test_mark.py \
		--ignore={dir}/testing/test_terminal.py \
		-k 'not test_trial_pdb' \
		{dir}/testing
# Disable more tests in pypy, because we don't have pypy-mock
export PYBUILD_TEST_ARGS_pypy=\
	cd {dir}/debian/tmp/test-working-directory && \
	{interpreter} -m pytest --lsof -rfsxX \
		--ignore={dir}/testing/freeze \
		--ignore={dir}/testing/test_entry_points.py \
		--ignore={dir}/testing/test_pdb.py \
		--ignore={dir}/testing/test_mark.py \
		--ignore={dir}/testing/test_terminal.py \
		--ignore={dir}/testing/code/test_code.py \
		-k 'not test_trial_pdb and not test_fixture_mock_integration' \
		{dir}/testing

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

override_dh_auto_build:
	dh_auto_build
	PYTHONPATH=$(CURDIR)/src \
		SPHINXBUILD=/usr/share/sphinx/scripts/python3/sphinx-build \
		$(MAKE) -C doc/en man html
	sed 's/PYTEST/PYTEST-3/g' doc/en/_build/man/pytest.1 > debian/pytest-3.1
	sed 's/PYTEST/PYTEST-PYPY/g' doc/en/_build/man/pytest.1 > debian/pytest-pypy.1

# 2015-12-16 barry@debian.org: Because pytest does not clean up after itself,
# use a custom temporary directory (which is easier to clean up manually,
# e.g. in an sbuild).
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	dh_auto_test -- --system=custom
endif

override_dh_auto_install:
	dh_auto_install
	rm debian/python-pytest/usr/bin/py.test
	rm debian/python3-pytest/usr/bin/py.test
	rm debian/pypy-pytest/usr/bin/py.test
	mv debian/python3-pytest/usr/bin/pytest \
		debian/python3-pytest/usr/bin/pytest-3
	mv debian/pypy-pytest/usr/bin/pytest \
		debian/pypy-pytest/usr/bin/pytest-pypy

override_dh_auto_clean:
	rm -rf doc/en/_build
	dh_auto_clean