summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>2010-02-21 17:58:03 +0000
committerArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>2010-02-21 17:58:03 +0000
commit451e3c3115ff7601847a379737fa004f05cf28bf (patch)
tree895e3015c905c1e1f1846c228f932bf238abc45e /dev-python
parentAutomated update of use.local.desc (diff)
downloadgentoo-2-451e3c3115ff7601847a379737fa004f05cf28bf.tar.gz
gentoo-2-451e3c3115ff7601847a379737fa004f05cf28bf.tar.bz2
gentoo-2-451e3c3115ff7601847a379737fa004f05cf28bf.zip
Fix tests (bug #297468).
(Portage version: 15417-svn/cvs/Linux x86_64)
Diffstat (limited to 'dev-python')
-rw-r--r--dev-python/astng/ChangeLog10
-rw-r--r--dev-python/astng/astng-0.19.3-r1.ebuild71
-rw-r--r--dev-python/astng/files/astng-0.19.3-fix_tests.patch16
3 files changed, 95 insertions, 2 deletions
diff --git a/dev-python/astng/ChangeLog b/dev-python/astng/ChangeLog
index 996b81105a27..9d7f0184e240 100644
--- a/dev-python/astng/ChangeLog
+++ b/dev-python/astng/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for dev-python/astng
-# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-python/astng/ChangeLog,v 1.29 2009/12/19 17:38:00 arfrever Exp $
+# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-python/astng/ChangeLog,v 1.30 2010/02/21 17:58:02 arfrever Exp $
+
+*astng-0.19.3-r1 (21 Feb 2010)
+
+ 21 Feb 2010; Arfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>
+ +astng-0.19.3-r1.ebuild, +files/astng-0.19.3-fix_tests.patch:
+ Fix tests (bug #297468).
*astng-0.19.3 (19 Dec 2009)
diff --git a/dev-python/astng/astng-0.19.3-r1.ebuild b/dev-python/astng/astng-0.19.3-r1.ebuild
new file mode 100644
index 000000000000..bac8a37a104e
--- /dev/null
+++ b/dev-python/astng/astng-0.19.3-r1.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-python/astng/astng-0.19.3-r1.ebuild,v 1.1 2010/02/21 17:58:02 arfrever Exp $
+
+EAPI="2"
+PYTHON_DEPEND="2"
+SUPPORT_PYTHON_ABIS="1"
+
+inherit distutils eutils
+
+DESCRIPTION="Abstract Syntax Tree New Generation for logilab packages"
+HOMEPAGE="http://www.logilab.org/projects/astng/ http://pypi.python.org/pypi/logilab-astng"
+SRC_URI="ftp://ftp.logilab.org/pub/astng/logilab-${P}.tar.gz http://pypi.python.org/packages/source/l/logilab-astng/logilab-${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-macos"
+IUSE="test"
+
+RDEPEND=">=dev-python/logilab-common-0.39.0"
+DEPEND="${RDEPEND}
+ test? ( >=dev-python/egenix-mx-base-3.0.0 )"
+RESTRICT_PYTHON_ABIS="3.*"
+
+S="${WORKDIR}/logilab-${P}"
+
+PYTHON_MODNAME="logilab/astng"
+
+src_prepare() {
+ distutils_src_prepare
+
+ epatch "${FILESDIR}/${P}-fix_tests.patch"
+}
+
+src_test() {
+ testing() {
+ local sdir="${T}/test/$(python_get_sitedir)"
+
+ # This is a hack to make tests work without installing to the live
+ # filesystem. We copy part of the logilab site-packages to a temporary
+ # dir, install there, and run from there.
+ mkdir -p "${sdir}/logilab" || die
+ cp -r "$(python_get_sitedir)/logilab/common" "${sdir}/logilab" || die "copying logilab-common failed!"
+
+ "$(PYTHON)" setup.py install --root="${T}/test" || die "test copy failed"
+
+ # Pytest picks up tests relative to the current dir, so cd in.
+ pushd "${sdir}/logilab/astng" > /dev/null || die
+ PYTHONPATH="${sdir}" pytest -v || die "tests failed"
+ popd > /dev/null
+ }
+ python_execute_function testing
+}
+
+src_install() {
+ distutils_src_install
+
+ deletion_of_unneeded_files() {
+ [[ -z "${ED}" ]] && local ED="${D}"
+ local sdir="${ED}$(python_get_sitedir)/logilab"
+
+ # we need to remove this file because it collides with the one
+ # from logilab-common (which we depend on).
+ # Bug 111970 and bug 223025
+ rm -f "${sdir}/__init__.py" || die
+
+ # Remove unittests since they're just needed during build-time
+ rm -fr "${sdir}/astng/test" || die
+ }
+ python_execute_function --action-message 'Deletion of unneeded files with Python ${PYTHON_ABI}' deletion_of_unneeded_files
+}
diff --git a/dev-python/astng/files/astng-0.19.3-fix_tests.patch b/dev-python/astng/files/astng-0.19.3-fix_tests.patch
new file mode 100644
index 000000000000..acf79e65801e
--- /dev/null
+++ b/dev-python/astng/files/astng-0.19.3-fix_tests.patch
@@ -0,0 +1,16 @@
+https://bugs.gentoo.org/show_bug.cgi?id=297468
+http://www.logilab.org/cgi-bin/hgwebdir.cgi/logilab/astng/rev/5a507ae61261
+
+--- inference.py
++++ inference.py
+@@ -50,9 +50,7 @@
+ _CONST_PROXY[type(None)].parent = _CONST_PROXY[bool].parent
+
+ def _set_proxied(const):
+- if not hasattr(const, '__proxied'):
+- const.__proxied = _CONST_PROXY[const.value.__class__]
+- return const.__proxied
++ return _CONST_PROXY[const.value.__class__]
+ nodes.Const._proxied = property(_set_proxied)
+
+ nodes.Const.__bases__ += (Instance,)