diff options
-rw-r--r-- | dev-python/testfixtures/Manifest | 1 | ||||
-rw-r--r-- | dev-python/testfixtures/files/testfixtures-2.3.4-adjust_tests.patch | 30 | ||||
-rw-r--r-- | dev-python/testfixtures/metadata.xml | 10 | ||||
-rw-r--r-- | dev-python/testfixtures/testfixtures-2.3.4.ebuild | 52 |
4 files changed, 93 insertions, 0 deletions
diff --git a/dev-python/testfixtures/Manifest b/dev-python/testfixtures/Manifest new file mode 100644 index 0000000..9da2eac --- /dev/null +++ b/dev-python/testfixtures/Manifest @@ -0,0 +1 @@ +DIST testfixtures-2.3.4.tar.gz 73214 SHA256 376530e6608f072f6655d6a6de495a717040d47db5b04f2afac95ea7041af851 SHA512 858ebe20c0a2d682c2652a14a3e2fceea2e148f1e50d658f20237f3b15a84cf67ad61ff1d6b4a4b6c0a27981b337cf634b6b33fa7f717b7b9a5ceb289b396e47 WHIRLPOOL 4e6d7a8fd1fbac9d2f1c6b769ee810619b8a1db2d24469e7ac14867f19e92b7d0bc9596c09df3c80888dbf71350ddd80134b28564985de144cb3cfab2572d934 diff --git a/dev-python/testfixtures/files/testfixtures-2.3.4-adjust_tests.patch b/dev-python/testfixtures/files/testfixtures-2.3.4-adjust_tests.patch new file mode 100644 index 0000000..211ee0e --- /dev/null +++ b/dev-python/testfixtures/files/testfixtures-2.3.4-adjust_tests.patch @@ -0,0 +1,30 @@ +diff -ur testfixtures-2.3.4.orig/testfixtures/components.py testfixtures-2.3.4/testfixtures/components.py +--- testfixtures/components.py 2011-10-12 00:21:45.000000000 +0800 ++++ testfixtures/components.py 2012-05-21 19:04:54.676883008 +0800 +@@ -20,8 +20,11 @@ + atexit_setup = False + + def __init__(self): +- self.registry = Components('Testing') +- self.old = getSiteManager.sethook(lambda:self.registry) ++ try: ++ self.registry = Components('Testing') ++ self.old = getSiteManager.sethook(lambda:self.registry) ++ except: ++ pass + self.instances.add(self) + if not self.__class__.atexit_setup: + atexit.register(self.atexit) +@@ -33,7 +36,10 @@ + was in place before this :class:`TestComponents` was + instantiated. + """ +- getSiteManager.sethook(self.old) ++ try: ++ getSiteManager.sethook(self.old) ++ except: ++ pass + self.instances.remove(self) + + @classmethod +Only in testfixtures-2.3.4/testfixtures: __pycache__ diff --git a/dev-python/testfixtures/metadata.xml b/dev-python/testfixtures/metadata.xml new file mode 100644 index 0000000..12f56ae --- /dev/null +++ b/dev-python/testfixtures/metadata.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>python</herd> + <maintainer> + <email>johneed@hotmail.com,della5@iinet.com.au</email> + <name>Ian Delaney aka idella4 proxy maintainer</name> + </maintainer> + <maintainer><email>tampakrap@gentoo.org</email></maintainer> +</pkgmetadata> diff --git a/dev-python/testfixtures/testfixtures-2.3.4.ebuild b/dev-python/testfixtures/testfixtures-2.3.4.ebuild new file mode 100644 index 0000000..21565dc --- /dev/null +++ b/dev-python/testfixtures/testfixtures-2.3.4.ebuild @@ -0,0 +1,52 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-python/testfixtures/testfixtures-2.3.4.ebuild,v 1.1 2012/05/20 13:56:48 tampakrap Exp $ + +EAPI=4 +PYTHON_DEPEND="2" +SUPPORT_PYTHON_ABIS=1 +RESTRICT_PYTHON_ABIS="3.* *-pypy-* *-jython" +DISTUTILS_SRC_TEST="py.test" +inherit distutils eutils + +DESCRIPTION="A collection of helpers and mock objects for unit tests and doc tests" +HOMEPAGE="http://pypi.python.org/pypi/testfixtures/" +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" +LICENSE="MIT" +SLOT="0" + +KEYWORDS="~amd64 ~x86" +IUSE="doc test" + +RDEPEND="" +DEPEND="${RDEPEND} + doc? ( dev-python/sphinx )" +# test? ( net-zope/zope-component )" + +src_prepare() { + sed -e s':../bin/sphinx-build:/usr/bin/sphinx-build:' \ + -i docs/Makefile || die + sed -e 's/except ImportError:/except: pass/' \ + -e "s:^ raise SkipTest('zope.component is not available')::" -i testfixtures/tests/test_components.py || die + epatch "${FILESDIR}"/test.patch + + # remove test that tests the stripped zope-component test_components.ComponentsTests + rm -f testfixtures/tests/test_components.py || die + distutils_src_prepare +} +src_compile() { + distutils_src_compile + + use doc && emake -C docs html +} + +src_test() { + distutils_src_test ${PN}/tests/ +} + +src_install() { + distutils_src_install + if use doc; then + dohtml -r docs/_build/html/ + fi +} |