Lines 14-33
Link Here
|
14 |
LICENSE="LGPL-2.1" |
14 |
LICENSE="LGPL-2.1" |
15 |
SLOT="0" |
15 |
SLOT="0" |
16 |
KEYWORDS="~amd64 ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" |
16 |
KEYWORDS="~amd64 ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" |
17 |
IUSE="test" |
17 |
IUSE="test doc" |
18 |
|
18 |
|
19 |
# dev-python/unittest2 is not required with Python >=3.2. |
19 |
# dev-python/unittest2 is not required with Python >=3.2. |
20 |
RDEPEND="dev-python/setuptools |
20 |
RDEPEND="dev-python/setuptools |
21 |
dev-python/unittest2" |
21 |
dev-python/unittest2" |
|
|
22 |
|
22 |
# Tests using dev-python/psycopg are skipped when dev-python/psycopg isn't installed. |
23 |
# Tests using dev-python/psycopg are skipped when dev-python/psycopg isn't installed. |
23 |
DEPEND="${RDEPEND} |
24 |
DEPEND="${RDEPEND} |
24 |
test? ( |
25 |
test? ( |
25 |
dev-python/egenix-mx-base |
26 |
dev-python/egenix-mx-base |
26 |
!dev-python/psycopg[-mxdatetime] |
27 |
!dev-python/psycopg[-mxdatetime] |
27 |
)" |
28 |
) |
|
|
29 |
doc? ( dev-python/epydoc )" |
28 |
|
30 |
|
29 |
PYTHON_MODNAME="logilab" |
31 |
PYTHON_MODNAME="logilab" |
30 |
|
32 |
|
|
|
33 |
src_prepare() { |
34 |
use doc && sed -e 's:(CURDIR):{S}/${P}:' -i doc/makefile || return |
35 |
} |
36 |
|
37 |
src_compile() { |
38 |
distutils_src_compile |
39 |
|
40 |
# Simplest way to make makefile point to the right place. |
41 |
mklinks() { |
42 |
# dosym it seems is restricted to src_install. |
43 |
ln -s build-${PYTHON_ABI} build |
44 |
emake -C doc epydoc |
45 |
rm build |
46 |
} |
47 |
use doc && python_execute_function -f mklinks |
48 |
} |
49 |
|
50 |
# Tests are devastated by use of abs paths. grep abspath yields dozens of entries in test files. |
51 |
# Unusable. Need install for each desired ABI so they can import from installed instance to run tests |
31 |
src_test() { |
52 |
src_test() { |
32 |
testing() { |
53 |
testing() { |
33 |
# Install temporarily. |
54 |
# Install temporarily. |
Lines 37-50
Link Here
|
37 |
"$(PYTHON)" setup.py build -b "build-${PYTHON_ABI}" install --root="${tpath}" || die "Installation for tests failed with $(python_get_implementation) $(python_get_version)" |
58 |
"$(PYTHON)" setup.py build -b "build-${PYTHON_ABI}" install --root="${tpath}" || die "Installation for tests failed with $(python_get_implementation) $(python_get_version)" |
38 |
|
59 |
|
39 |
# pytest uses tests placed relatively to the current directory. |
60 |
# pytest uses tests placed relatively to the current directory. |
|
|
61 |
# NOT ANY MORE |
40 |
pushd "${spath}" > /dev/null || return 1 |
62 |
pushd "${spath}" > /dev/null || return 1 |
41 |
if [[ "${PYTHON_ABI}" == 3.* ]]; then |
63 |
if [[ "${PYTHON_ABI}" == 3.* ]]; then |
|
|
64 |
pushd "${spath}" > /dev/null || return 1 |
42 |
# Support for Python 3 is experimental. Some tests are known to fail. |
65 |
# Support for Python 3 is experimental. Some tests are known to fail. |
43 |
PYTHONPATH="${spath}" "$(PYTHON)" "${tpath}${EPREFIX}/usr/bin/pytest" -v |
66 |
PYTHONPATH="${spath}" "$(PYTHON)" "${tpath}${EPREFIX}/usr/bin/pytest" -v |
44 |
else |
67 |
else |
45 |
PYTHONPATH="${spath}" "$(PYTHON)" "${tpath}${EPREFIX}/usr/bin/pytest" -v || return 1 |
68 |
#PYTHONPATH="build-${PYTHON_ABI}/lib/" "$(PYTHON)" build-"${PYTHON_ABI}/scripts-${PYTHON_ABI:0:3}"/pytest || return 1 |
|
|
69 |
"${tpath}${EPREFIX}/usr/bin/pytest" -v || return 1 |
46 |
fi |
70 |
fi |
47 |
popd > /dev/null || return 1 |
71 |
# popd > /dev/null || return 1 |
48 |
} |
72 |
} |
49 |
python_execute_function testing |
73 |
python_execute_function testing |
50 |
} |
74 |
} |
Lines 60-63
Link Here
|
60 |
rm -fr "${ED}$(python_get_sitedir)/${PN/-//}/test" |
84 |
rm -fr "${ED}$(python_get_sitedir)/${PN/-//}/test" |
61 |
} |
85 |
} |
62 |
python_execute_function -q delete_tests |
86 |
python_execute_function -q delete_tests |
|
|
87 |
use doc && dohtml -r doc/apidoc/ |
63 |
} |
88 |
} |