aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Delaney <della5@iinet.com.au>2012-05-19 02:25:05 +0800
committerIan Delaney <della5@iinet.com.au>2012-05-19 02:25:05 +0800
commit77736ac6fc9863e75053ca4b00f1eb75c0f58d22 (patch)
treed9f1eb029d1aff93162a727d014e4a9943acf278
parent[dev-python/sqlite3dbm] Corrected prepare, compile (diff)
downloadimprovise-77736ac6fc9863e75053ca4b00f1eb75c0f58d22.tar.gz
improvise-77736ac6fc9863e75053ca4b00f1eb75c0f58d22.tar.bz2
improvise-77736ac6fc9863e75053ca4b00f1eb75c0f58d22.zip
[dev-python/bottle] ebuild made to support python3
(Portage version: 2.1.10.56/git/Linux x86_64, unsigned Manifest commit)
-rw-r--r--dev-python/bottle/bottle-0.10.9.ebuild28
-rw-r--r--dev-python/bottle/files/bottle-0.10.9-python3tests.patch13
2 files changed, 32 insertions, 9 deletions
diff --git a/dev-python/bottle/bottle-0.10.9.ebuild b/dev-python/bottle/bottle-0.10.9.ebuild
index b81bf22..cdeb49a 100644
--- a/dev-python/bottle/bottle-0.10.9.ebuild
+++ b/dev-python/bottle/bottle-0.10.9.ebuild
@@ -5,33 +5,43 @@
EAPI=4
PYTHON_DEPEND="2"
SUPPORT_PYTHON_ABIS=1
-RESTRICT_PYTHON_ABIS="3.* *-jython"
+RESTRICT_PYTHON_ABIS="*-jython"
inherit distutils eutils
DESCRIPTION="A fast and simple micro-framework for small web-applications"
HOMEPAGE="http://pypi.python.org/pypi/bottle http://bottlepy.org/"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
-KEYWORDS="~amd64"
-IUSE=""
LICENSE="MIT"
SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
PYTHON_MODNAME=bottle.py
-RDEPEND=""
+RDEPEND="dev-python/simplejson"
DEPEND="${RDEPEND} dev-python/setuptools"
src_prepare() {
- # Use of the patch skirts the bash expansion
- sed -e "s:./views:"${S}"/test/views:" -i test/test_jinja2.py || return
- epatch "${FILESDIR}"/${P}-test.patch
+ distutils_src_prepare
+
+ sed -e "/^sys.path.insert/d" -i test/{servertest.py,testall.py} || die
+ epatch "${FILESDIR}"/bottle-0.10.9-python3tests.patch
}
-# This generic approach works with coverage output.
src_test() {
testing() {
- $(PYTHON) -d -m test/testall
+ if [[ $(python_get_version --major) == "3" ]]; then
+ # test/views are templates, data files, not copied over
+ cp -a test/views/ build-${PYTHON_ABI}/lib/test/ || die "data file did not copy"
+ pushd build-${PYTHON_ABI}/lib/ > /dev/null
+ PYTHONPATH=. "$(PYTHON)" test/testall.py
+ popd > /dev/null
+ else
+ # folder test in ${S} is Python2 compliant
+ PYTHONPATH="build-${PYTHON_ABI}/lib/" "$(PYTHON)" test/testall.py
+ fi
}
python_execute_function testing
}
diff --git a/dev-python/bottle/files/bottle-0.10.9-python3tests.patch b/dev-python/bottle/files/bottle-0.10.9-python3tests.patch
new file mode 100644
index 0000000..de8a2a8
--- /dev/null
+++ b/dev-python/bottle/files/bottle-0.10.9-python3tests.patch
@@ -0,0 +1,13 @@
+diff -ur bottle-0.10.9.orig/setup.py bottle-0.10.9/setup.py
+--- setup.py 2012-02-12 02:43:46.000000000 +0800
++++ setup.py 2012-05-19 00:25:44.750914193 +0800
+@@ -40,7 +40,8 @@
+ 'Topic :: Software Development :: Libraries :: Application Frameworks',
+ 'Programming Language :: Python :: 2.6',
+ 'Programming Language :: Python :: 3'],
+- cmdclass = {'build_py': build_py}
++ cmdclass = {'build_py': build_py},
++ packages=["test"]
+ )
+
+