You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
90 lines
2.6 KiB
90 lines
2.6 KiB
12 years ago
|
# Copyright 1999-2012 Gentoo Foundation
|
||
13 years ago
|
# Distributed under the terms of the GNU General Public License v2
|
||
12 years ago
|
# $Header: /var/cvsroot/gentoo-x86/dev-python/logilab-common/logilab-common-0.58.1-r1.ebuild,v 1.1 2012/11/05 17:48:10 idella4 Exp $
|
||
13 years ago
|
|
||
12 years ago
|
EAPI="4"
|
||
13 years ago
|
SUPPORT_PYTHON_ABIS="1"
|
||
12 years ago
|
# Current tally of 8 test failures for python3
|
||
|
#PYTHON_TESTS_RESTRICTED_ABIS="3.*"
|
||
13 years ago
|
|
||
|
inherit distutils
|
||
|
|
||
|
DESCRIPTION="Useful miscellaneous modules used by Logilab projects"
|
||
12 years ago
|
HOMEPAGE="http://www.logilab.org/project/logilab-common http://pypi.python.org/pypi/logilab-common"
|
||
13 years ago
|
SRC_URI="ftp://ftp.logilab.org/pub/common/${P}.tar.gz mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
|
||
|
|
||
|
LICENSE="LGPL-2.1"
|
||
|
SLOT="0"
|
||
12 years ago
|
KEYWORDS="~amd64 ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
|
||
|
IUSE="test doc"
|
||
13 years ago
|
|
||
|
# dev-python/unittest2 is not required with Python >=3.2.
|
||
|
RDEPEND="dev-python/setuptools
|
||
|
dev-python/unittest2"
|
||
12 years ago
|
|
||
13 years ago
|
# Tests using dev-python/psycopg are skipped when dev-python/psycopg isn't installed.
|
||
|
DEPEND="${RDEPEND}
|
||
|
test? (
|
||
|
dev-python/egenix-mx-base
|
||
|
!dev-python/psycopg[-mxdatetime]
|
||
12 years ago
|
)
|
||
|
doc? ( dev-python/epydoc )"
|
||
13 years ago
|
|
||
|
PYTHON_MODNAME="logilab"
|
||
|
|
||
12 years ago
|
src_prepare() {
|
||
|
if use doc; then
|
||
|
sed -e 's:(CURDIR):{S}/${P}:' -i doc/makefile || die
|
||
|
fi
|
||
|
distutils_src_prepare
|
||
|
}
|
||
|
|
||
|
src_compile() {
|
||
|
distutils_src_compile
|
||
|
|
||
|
# Simplest way to make makefile point to the right place.
|
||
|
mklinks() {
|
||
|
# dosym it seems is restricted to src_install.
|
||
|
ln -s build-${PYTHON_ABI} build
|
||
|
emake -C doc epydoc
|
||
|
rm build
|
||
|
}
|
||
|
use doc && python_execute_function -f mklinks
|
||
|
}
|
||
|
|
||
13 years ago
|
src_test() {
|
||
|
testing() {
|
||
|
# Install temporarily.
|
||
|
local tpath="${T}/test-${PYTHON_ABI}"
|
||
|
local spath="${tpath}${EPREFIX}$(python_get_sitedir)"
|
||
|
|
||
|
"$(PYTHON)" setup.py build -b "build-${PYTHON_ABI}" install --root="${tpath}" || die "Installation for tests failed with $(python_get_implementation) $(python_get_version)"
|
||
|
|
||
|
# pytest uses tests placed relatively to the current directory.
|
||
|
pushd "${spath}" > /dev/null || return 1
|
||
|
if [[ "${PYTHON_ABI}" == 3.* ]]; then
|
||
|
# Support for Python 3 is experimental. Some tests are known to fail.
|
||
12 years ago
|
PYTHONPATH=.:/logilab/common/test "${tpath}${EPREFIX}/usr/bin/pytest" -v || return 1
|
||
13 years ago
|
else
|
||
12 years ago
|
PYTHONPATH="${spath}" "${tpath}${EPREFIX}/usr/bin/pytest" -v || return 1
|
||
13 years ago
|
fi
|
||
|
popd > /dev/null || return 1
|
||
|
}
|
||
|
python_execute_function testing
|
||
|
}
|
||
|
|
||
|
src_install() {
|
||
|
distutils_src_install
|
||
|
|
||
|
python_generate_wrapper_scripts -E -f -q "${ED}usr/bin/pytest"
|
||
|
|
||
|
doman doc/pytest.1 || die "doman failed"
|
||
|
|
||
|
delete_tests() {
|
||
|
rm -fr "${ED}$(python_get_sitedir)/${PN/-//}/test"
|
||
|
}
|
||
12 years ago
|
|
||
|
use doc && dohtml -r doc/apidoc/
|
||
13 years ago
|
python_execute_function -q delete_tests
|
||
|
}
|