|
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 |
# This is modelled from logilab-common. The setup.py sets an approach to utilise absolute paths. |
| 44 |
# Consequently the usual PYTHONPATH=build-$(python_get_version) is rendered useless. |
| 45 |
# To run tests with pytest, need to copy the required logilab-common content into ${WORKDIR}. |
| 46 |
# To offset, need to also copy in /usr/bin/pytest, owned by logilab-common. |
| 47 |
|
| 48 |
src_test() { |
| 49 |
testing() { |
| 50 |
# Install temporarily. |
| 51 |
local exit_status=0 |
| 52 |
local tpath="${T}/test-${PYTHON_ABI}" |
| 53 |
local spath="${tpath}${EPREFIX}$(python_get_sitedir)" |
| 54 |
|
| 55 |
mkdir -p "${spath}/logilab" && mkdir -p ${tpath}${EPREFIX}/usr/bin || return |
| 56 |
cp -r "${EPREFIX}$(python_get_sitedir)/logilab/common" "${spath}/logilab" || return |
| 57 |
cp -r /usr/bin/pytest ${tpath}${EPREFIX}/usr/bin/ || return |
| 58 |
|
| 59 |
"$(PYTHON)" setup.py build -b "build-${PYTHON_ABI}" install --root="${tpath}" \ |
| 60 |
|| die "Installation for tests failed with $(python_get_implementation_and_version)" |
| 61 |
|
| 62 |
# pytest uses tests placed relatively to the current directory. |
| 63 |
pushd "${spath}" > /dev/null || exit_status=1 |
| 64 |
PYTHONPATH="${spath}" /usr/bin/pytest -v |
| 65 |
popd > /dev/null || exit_status=1 |
| 66 |
return $exit_status |
| 67 |
} |
| 68 |
python_execute_function testing |
| 69 |
} |