Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 415419 | Differences between
and this patch

Collapse All | Expand All

(-)../logilab-constraint.orig/logilab-constraint-0.5.0.ebuild (-5 / +33 lines)
Lines 1-18 Link Here
1
# Copyright 1999-2012 Gentoo Foundation
1
# Copyright 1999-2012 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
2
# Distributed under the terms of the GNU General Public License v2
3
# $Header: /var/cvsroot/gentoo-x86/dev-python/logilab-constraint/logilab-constraint-0.4.0.ebuild,v 1.8 2012/04/12 16:00:56 xarthisius Exp $
3
# $Header: /var/cvsroot/gentoo-x86/dev-python/logilab-constraint/logilab-constraint-0.5.0.ebuild,v 1.8 2012/04/12 16:00:56 xarthisius Exp $
4
4
5
EAPI="3"
5
EAPI="4"
6
PYTHON_DEPEND="2"
6
PYTHON_DEPEND="2"
7
SUPPORT_PYTHON_ABIS="1"
7
SUPPORT_PYTHON_ABIS="1"
8
RESTRICT_PYTHON_ABIS="3.*"
8
RESTRICT_PYTHON_ABIS="3.*"
9
9
PYTHON_TESTS_RESTRICTED_ABIS="2.7-pypy-*"
10
inherit distutils
10
inherit distutils
11
11
12
MY_P="${P#logilab-}"
13
DESCRIPTION="A finite domain constraints solver written in 100% pure Python"
12
DESCRIPTION="A finite domain constraints solver written in 100% pure Python"
14
HOMEPAGE="http://www.logilab.org/projects/constraint/"
13
HOMEPAGE="http://www.logilab.org/projects/constraint/"
15
SRC_URI="ftp://ftp.logilab.org/pub/constraint/${MY_P}.tar.gz"
14
SRC_URI="ftp://ftp.logilab.org/pub/constraint/${P}.tar.gz"
16
15
17
LICENSE="GPL-2"
16
LICENSE="GPL-2"
18
SLOT="0"
17
SLOT="0"
Lines 40-42 Link Here
40
		doins -r examples
39
		doins -r examples
41
	fi
40
	fi
42
}
41
}
42
43
# The setup.py sets a 'rule or approach' to utilise absolute paths.  Consequently the usual 
44
#  PYTHONPATH=build-$(python_get_version) is rendered useless. This is modelled from logilab-common. 
45
# To run tests with pytest, need to copy the required logilab-common content into ${WORKDIR}.
46
# Arfrever's 'version' manages it with the exclusive python_execute.  To offset, need to also 
47
# copy in /usr/bin/pytest, owned by logilab-common. Hey presto; tests all pass with coverage.
48
49
src_test() {
50
	testing() {
51
		# Install temporarily.
52
		local exit_status=0
53
		local tpath="${T}/test-${PYTHON_ABI}"
54
		local spath="${tpath}${EPREFIX}$(python_get_sitedir)"
55
56
		mkdir -p "${spath}/logilab" && mkdir -p ${tpath}${EPREFIX}/usr/bin || return
57
		cp -r "${EPREFIX}$(python_get_sitedir)/logilab/common" "${spath}/logilab" || return
58
		cp -r /usr/bin/pytest ${tpath}${EPREFIX}/usr/bin/ || return
59
60
		"$(PYTHON)" setup.py build -b "build-${PYTHON_ABI}" install --root="${tpath}" \
61
		|| die "Installation for tests failed with $(python_get_implementation_and_version)"
62
63
		# pytest uses tests placed relatively to the current directory.
64
		pushd "${spath}" > /dev/null || exit_status=1
65
		PYTHONPATH="${spath}" /usr/bin/pytest -v
66
		popd > /dev/null || exit_status=1
67
		return $exit_status
68
	}
69
	python_execute_function testing
70
}

Return to bug 415419