dev-python/bottle: Add python3.5 support
authorJustin Lecher <jlec@gentoo.org>
Tue, 20 Oct 2015 08:26:20 +0000 (10:26 +0200)
committerJustin Lecher <jlec@gentoo.org>
Wed, 21 Oct 2015 13:40:24 +0000 (15:40 +0200)
fix test deps

Package-Manager: portage-2.2.23
Signed-off-by: Justin Lecher <jlec@gentoo.org>
dev-python/bottle/bottle-0.12.8.ebuild
dev-python/bottle/files/bottle-0.12.8-py3.5-backport.patch [new file with mode: 0644]

index d5917b600c69a40588de38d661d06b43098585cb..bfa6f51c54266f9b2b0f55da78afbf24d396cc70 100644 (file)
@@ -4,8 +4,9 @@
 
 EAPI=5
 
-PYTHON_COMPAT=( python{2_7,3_3,3_4} pypy pypy3 )
-inherit distutils-r1
+PYTHON_COMPAT=( python2_7 python3_{3,4,5} pypy pypy3 )
+
+inherit distutils-r1 eutils
 
 DESCRIPTION="A fast and simple micro-framework for small web-applications"
 HOMEPAGE="https://pypi.python.org/pypi/bottle http://bottlepy.org/"
@@ -14,11 +15,15 @@ SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
 LICENSE="MIT"
 SLOT="0"
 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
-IUSE=""
+IUSE="test"
 
-DEPEND=""
+DEPEND="test? ( dev-python/mako[$(python_gen_usedep 'python*')] )"
 RDEPEND=""
 
+PATCHES=(
+       "${FILESDIR}"/${P}-py3.5-backport.patch
+)
+
 python_prepare_all() {
        sed -i -e '/scripts/d' setup.py || die
 
@@ -34,6 +39,7 @@ python_test() {
 }
 
 pkg_postinst() {
+       optfeature "Templating support" dev-python/mako
        elog "Due to problems with bottle.py being in /usr/bin (see bug #474874)"
        elog "we do as most other distros and do not install the script anymore."
        elog "If you do want/have to call it directly rather than through your app,"
diff --git a/dev-python/bottle/files/bottle-0.12.8-py3.5-backport.patch b/dev-python/bottle/files/bottle-0.12.8-py3.5-backport.patch
new file mode 100644 (file)
index 0000000..86e1ac0
--- /dev/null
@@ -0,0 +1,36 @@
+ test/test_environ.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/test/test_environ.py b/test/test_environ.py
+old mode 100755
+new mode 100644
+index 2b8079b..2feebe3
+--- a/test/test_environ.py
++++ b/test/test_environ.py
+@@ -592,7 +592,7 @@ class TestResponse(unittest.TestCase):
+         r.set_cookie('name2', 'value', max_age=datetime.timedelta(days=1))
+         cookies = sorted([value for name, value in r.headerlist
+                    if name.title() == 'Set-Cookie'])
+-        self.assertEqual(cookies[0], 'name1=value; Max-Age=5')
++        self.assertEqual(cookies[0].lower(), 'name1=value; max-age=5')
+         self.assertEqual(cookies[1], 'name2=value; Max-Age=86400')
+ 
+     def test_set_cookie_expires(self):
+@@ -602,7 +602,7 @@ class TestResponse(unittest.TestCase):
+         r.set_cookie('name2', 'value', expires=datetime.datetime(1970,1,1,0,0,43))
+         cookies = sorted([value for name, value in r.headerlist
+                    if name.title() == 'Set-Cookie'])
+-        self.assertEqual(cookies[0], 'name1=value; expires=Thu, 01 Jan 1970 00:00:42 GMT')
++        self.assertEqual(cookies[0].lower(), 'name1=value; expires=thu, 01 jan 1970 00:00:42 gmt')
+         self.assertEqual(cookies[1], 'name2=value; expires=Thu, 01 Jan 1970 00:00:43 GMT')
+ 
+     def test_delete_cookie(self):
+@@ -611,7 +611,7 @@ class TestResponse(unittest.TestCase):
+         response.delete_cookie('name')
+         cookies = [value for name, value in response.headerlist
+                    if name.title() == 'Set-Cookie']
+-        self.assertTrue('name=;' in cookies[0])
++        self.assertTrue('Max-Age=-1' in cookies[0])
+ 
+     def test_set_header(self):
+         response = BaseResponse()