Fix tests (bug #297468).
authorArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>
Sun, 21 Feb 2010 17:58:03 +0000 (17:58 +0000)
committerArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>
Sun, 21 Feb 2010 17:58:03 +0000 (17:58 +0000)
Package-Manager: portage-15417-svn/cvs/Linux x86_64

dev-python/astng/ChangeLog
dev-python/astng/Manifest
dev-python/astng/astng-0.19.3-r1.ebuild [new file with mode: 0644]
dev-python/astng/files/astng-0.19.3-fix_tests.patch [new file with mode: 0644]

index 996b81105a2785d2498021316cff9a333fe64f00..9d7f0184e2407da242b1aadca75593307a972c9f 100644 (file)
@@ -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)
 
index 489424c63584ec474490d661525274e6141e2021..7b06396086887bec813d8b0949ce3f8e46e70c78 100644 (file)
@@ -1,6 +1,8 @@
+AUX astng-0.19.3-fix_tests.patch 531 RMD160 99cf9969517eb4bdac44e1b18ec2fe3286f6bd9b SHA1 d34e08bba83836b300a953922966bcdb011b1fa6 SHA256 e2f09fa0b963bb3153cae0450e5472efae99e298ff7c722c5cb6b090b4b42879
 DIST logilab-astng-0.19.1.tar.gz 86956 RMD160 bc1a754bb8e54fbcc220d4fbf0a96e6e3a72b73b SHA1 20048e71e58fd7cbee440eece7dffca9af2c14fa SHA256 cf2b418149303bed0d6885ed9392f38ee13d2aa4b724bb5da0cc776082b3bc1f
 DIST logilab-astng-0.19.3.tar.gz 89875 RMD160 22bb50949ed7790271b4fb5055b6b0178857d750 SHA1 0d467e512b0c2b5b3e75d58de7f802e749290002 SHA256 21e7314980a45308d37239a2586390ca84e93f230e063909aa2193ad568db523
 EBUILD astng-0.19.1.ebuild 2020 RMD160 69f7884d7e3baf275cde43a290dcd6f4ea994b2f SHA1 689673beceacaede29698d19131879b719f5001f SHA256 8b5f62470a5bbad6575e5bc9f1db5ffb801b38bf52e9371044ab3183b2d2dc6a
+EBUILD astng-0.19.3-r1.ebuild 2264 RMD160 3f3b46db841bd5611d7dc7c93502949e9b3e8c9e SHA1 ff0fd34d1b528972927974ab4483749d2cc3f2d8 SHA256 8ba90d956ada80df49a6f9cb09d2e3093f0973ae92832eecda6e14d6c4ce88c0
 EBUILD astng-0.19.3.ebuild 2150 RMD160 e0e49052a83865ee16ed102a34669e5168d572d3 SHA1 452f252f51a0114401e22e76964dfa03b8a0e68d SHA256 746bc64844145e098e1991930b5b3c71079022188588cbedebee44f5d4da2326
-MISC ChangeLog 4174 RMD160 9bfb84b9343abf6a38a2288da03c494f78e88844 SHA1 88133063212628b973834dd50fbeb02f4a5872be SHA256 db1a20bcc714c68a5ba690a80e3bf1331b4a6545c1309cd4e806f05091da39b1
+MISC ChangeLog 4371 RMD160 6ca23f994d9bf7ff84cc83078adbafab92c00866 SHA1 1812a613589a1d374761f8c5cd126e06cbeceabc SHA256 5db8eb5e90a314295aecfe97ad2c5064743bd5a974955d641d1c2cda0302fc9f
 MISC metadata.xml 160 RMD160 e730f96ab97c5be577a6d6d05f04990374a0dffb SHA1 2aa5e6be9c265c0e7bceb78ee9fd20df5f818e36 SHA256 6cd954a9de2307c57d32b25fa3599dee2908a4ddc6a98594f593d53577307a3a
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 (file)
index 0000000..bac8a37
--- /dev/null
@@ -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 (file)
index 0000000..acf79e6
--- /dev/null
@@ -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,)