aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Delaney <della5@iinet.com.au>2012-05-16 02:46:36 +0800
committerIan Delaney <della5@iinet.com.au>2012-05-16 02:46:36 +0800
commitab910a2ed37e2f211d8fc36b5ee6633796e05f5b (patch)
tree16728e9097020aa79d7db6ce0492a4549a2e2644
parent[dev-python/fabric} version bump added (diff)
downloadimprovise-ab910a2ed37e2f211d8fc36b5ee6633796e05f5b.tar.gz
improvise-ab910a2ed37e2f211d8fc36b5ee6633796e05f5b.tar.bz2
improvise-ab910a2ed37e2f211d8fc36b5ee6633796e05f5b.zip
[dev-python/bottle] new ebuild refined
(Portage version: 2.1.10.56/git/Linux x86_64, unsigned Manifest commit)
-rw-r--r--dev-python/bottle/bottle-0.10.9.ebuild37
-rw-r--r--dev-python/bottle/files/bottle-0.10.9-test.patch83
2 files changed, 90 insertions, 30 deletions
diff --git a/dev-python/bottle/bottle-0.10.9.ebuild b/dev-python/bottle/bottle-0.10.9.ebuild
index 412b377..b81bf22 100644
--- a/dev-python/bottle/bottle-0.10.9.ebuild
+++ b/dev-python/bottle/bottle-0.10.9.ebuild
@@ -7,10 +7,10 @@ PYTHON_DEPEND="2"
SUPPORT_PYTHON_ABIS=1
RESTRICT_PYTHON_ABIS="3.* *-jython"
-inherit distutils
+inherit distutils eutils
DESCRIPTION="A fast and simple micro-framework for small web-applications"
-HOMEPAGE="http://pypi.python.org/pypi/bottle"
+HOMEPAGE="http://pypi.python.org/pypi/bottle http://bottlepy.org/"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
KEYWORDS="~amd64"
IUSE=""
@@ -22,39 +22,16 @@ PYTHON_MODNAME=bottle.py
RDEPEND=""
DEPEND="${RDEPEND} dev-python/setuptools"
-# dev friendly commentary; 1) They set root = os.path.abspath(root) + os.sep in bottle.py
-# Subsequently relative path ./views needs sed -> ${S}/test/views in test/test_jinja2.py
-# 2) ZeroDivisionError is absent from whatever file is tested in the test in test/test_outputfilter.py
-# Subsequently ZeroDivisionError -> Internal Server Error which is error 500 in the page.
-# 3)''' The virtual module needs a valid __file__ attribute.
-# If not, the Google app engine development server crashes on windows.'''
-# well linux isn't windows so it's not required for 'us' and the test suite does NOT warrant being held
-# to ransom over an irrelevant and trivial test. That aside, the func DOES appear to allocate __file__ attribute.
-# Yet another upstream issue to file.
-
src_prepare() {
- sed -e "s:./views:${S}/test/views:" -i test/test_jinja2.py || return
- sed -e 's:ZeroDivisionError:Internal Server Error:g' -i test/test_outputfilter.py || return
- sed -e "s/ self.assertTrue/# self.assertTrue/" -i test/test_importhook.py || return
+ # 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
}
-# more dev friendly commentary; 1 bottle.py; many test_file.py s.
-# This works for python2.7 since discovery is new && unique to it.
-#src_test() {
-# PYTHONPATH=.:test:$EROOT
-# testing() {
-# $(PYTHON) -m unittest discover test
-# }
-# python_execute_function testing
-#}
-
-# This generic approach works with coverage output. nosetests pulls errors which this doesn't in the same tests.
-
+# This generic approach works with coverage output.
src_test() {
testing() {
- local exit_status=0
- $(PYTHON) -d -m test/testall || exit_status=1
- return $exit_status
+ $(PYTHON) -d -m test/testall
}
python_execute_function testing
}
diff --git a/dev-python/bottle/files/bottle-0.10.9-test.patch b/dev-python/bottle/files/bottle-0.10.9-test.patch
new file mode 100644
index 0000000..d296ab8
--- /dev/null
+++ b/dev-python/bottle/files/bottle-0.10.9-test.patch
@@ -0,0 +1,83 @@
+# https://github.com/defnull/bottle/issues/323
+# 1) Upstream set root = os.path.abspath(root) + os.sep in bottle.py.
+# Subsequently relative path ./views needs "${S}"/test/views in test/test_jinja2.py
+# 2) ZeroDivisionError is absent from whatever file is tested in the test in test/test_outputfilter.py
+# Subsequently ZeroDivisionError -> Internal Server Error which is error 500 in the page.
+# 3)''' The virtual module needs a valid __file__ attribute.
+# If not, the Google app engine development server crashes on windows.'''
+# Linux isn't Windows so it's not required and the test suite does NOT warrant being held
+# to ransom over an irrelevant and trivial test.
+# That aside, the func DOES appear to allocate __file__ attribute.
+
+diff -ur
+bottle-0.10.9.orig/test/test_importhook.py
+bottle-0.10.9/test/test_importhook.py
+--- test/test_importhook.py 2011-12-23 23:00:02.000000000 +0800
++++ test/test_importhook.py 2012-05-13 21:49:29.377737727 +0800
+@@ -31,13 +31,6 @@
+ def test():
+ import bottle.ext.doesnotexist
+ self.assertRaises(ImportError, test)
+-
+- def test_ext_isfile(self):
+- ''' The virtual module needs a valid __file__ attribute.
+- If not, the Google app engine development server crashes on windows.
+- '''
+- from bottle import ext
+- self.assertTrue(os.path.isfile(ext.__file__))
+
+ if __name__ == '__main__': #pragma: no cover
+ unittest.main()
+diff -ur bottle-0.10.9.orig/test/test_outputfilter.py bottle-0.10.9/test/test_outputfilter.py
+--- test/test_outputfilter.py 2012-02-12 02:43:46.000000000 +0800
++++ test/test_outputfilter.py 2012-05-13 21:54:21.027744474 +0800
+@@ -36,7 +36,7 @@
+ def test_error(self):
+ self.app.route('/')(lambda: 1/0)
+ self.assertStatus(500)
+- self.assertInBody('ZeroDivisionError')
++ self.assertInBody('Internal Server Error')
+
+ def test_fatal_error(self):
+ @self.app.route('/')
+@@ -107,7 +107,7 @@
+ def test():
+ yield 1/0
+ self.assertStatus(500)
+- self.assertInBody('ZeroDivisionError')
++ self.assertInBody('Internal Server Error')
+
+ def test_fatal_error_in_generator_callback(self):
+ @self.app.route('/')
+# Tricky this: For some low level reason the use of a patch skirts the very purpose of the patch
+# i.e. to use the abs "${S}"; Use of the patch skirts the bash expansion, yielding
+#"${S}"/test/views/jinja2_simple.tpl
+# Use of sed sees the bash expansion take place
+#diff -ur bottle-0.10.9.orig/test/test_jinja2.py bottle-0.10.9/test/test_jinja2.py
+#--- test/test_jinja2.py 2012-02-12 02:43:46.000000000 +0800
+#+++ test/test_jinja2.py 2012-05-13 21:51:51.954740875 +0800
+#diff -ur bottle-0.10.9.orig/test/test_outputfilter.py bottle-0.10.9/test/test_outputfilter.py
+#@@ -12,12 +12,12 @@
+#
+# def test_file(self):
+# """ Templates: Jinja2 file"""
+#- t = Jinja2Template(name='./views/jinja2_simple.tpl').render(var='var')
+#+ t = Jinja2Template(name='${S}/test/views/jinja2_simple.tpl').render(var='var')
+# self.assertEqual('start var end', ''.join(t))
+#
+# def test_name(self):
+# """ Templates: Jinja2 lookup by name """
+#- t = Jinja2Template(name='jinja2_simple', lookup=['./views/']).render(var='var')
+#+ t = Jinja2Template(name='jinja2_simple', lookup=['"${S}"/test/views/']).render(var='var')
+# self.assertEqual('start var end', ''.join(t))
+#
+# def test_notfound(self):
+#@@ -30,7 +30,7 @@
+#
+# def test_inherit(self):
+# """ Templates: Jinja2 lookup and inherience """
+#- t = Jinja2Template(name='jinja2_inherit', lookup=['./views/']).render()
+#+ t = Jinja2Template(name='jinja2_inherit', lookup=['"${S}"/test/views/']).render()
+# self.assertEqual('begin abc end', ''.join(t))
+#
+# def test_custom_filters(self):