summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Delaney <idella4@gentoo.org>2014-06-28 10:52:00 +0000
committerIan Delaney <idella4@gentoo.org>2014-06-28 10:52:00 +0000
commit6de198e99d7500e80ed0d399df08a0d59b23dc13 (patch)
tree05ddc80050f659e24ee4f1e39e2fca5053c4e273 /dev-python/pycurl
parentStable for amd64, wrt bug #512492 (diff)
downloadgentoo-2-6de198e99d7500e80ed0d399df08a0d59b23dc13.tar.gz
gentoo-2-6de198e99d7500e80ed0d399df08a0d59b23dc13.tar.bz2
gentoo-2-6de198e99d7500e80ed0d399df08a0d59b23dc13.zip
add test deps, upstream patch, drop amd64-fbsd hppa x86-fbsd keywords to include test dep (for re-keywording), unrestrict and update test phase
(Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key 0xB8072B0D)
Diffstat (limited to 'dev-python/pycurl')
-rw-r--r--dev-python/pycurl/ChangeLog7
-rw-r--r--dev-python/pycurl/files/pycurl-7.19.3.1-ssl-test.patch64
-rw-r--r--dev-python/pycurl/pycurl-7.19.3.1.ebuild28
3 files changed, 83 insertions, 16 deletions
diff --git a/dev-python/pycurl/ChangeLog b/dev-python/pycurl/ChangeLog
index dd13f6d02df6..309d0276c4f1 100644
--- a/dev-python/pycurl/ChangeLog
+++ b/dev-python/pycurl/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for dev-python/pycurl
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-python/pycurl/ChangeLog,v 1.95 2014/06/15 15:22:12 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-python/pycurl/ChangeLog,v 1.96 2014/06/28 10:51:59 idella4 Exp $
+
+ 28 Jun 2014; Ian Delaney <idella4@gentoo.org>
+ +files/pycurl-7.19.3.1-ssl-test.patch, pycurl-7.19.3.1.ebuild:
+ add test deps, upstream patch, drop amd64-fbsd hppa x86-fbsd keywords to
+ include test dep (for re-keywording), unrestrict and update test phase
15 Jun 2014; Michał Górny <mgorny@gentoo.org> pycurl-7.19.0-r1.ebuild,
pycurl-7.19.0-r2.ebuild, pycurl-7.19.0-r3.ebuild, pycurl-7.19.3.1.ebuild:
diff --git a/dev-python/pycurl/files/pycurl-7.19.3.1-ssl-test.patch b/dev-python/pycurl/files/pycurl-7.19.3.1-ssl-test.patch
new file mode 100644
index 000000000000..c7e1580f54f4
--- /dev/null
+++ b/dev-python/pycurl/files/pycurl-7.19.3.1-ssl-test.patch
@@ -0,0 +1,64 @@
+https://github.com/p-push/pycurl/commit/8644393bec56cd05c19d5dbe420ff741ba899d10
+diff --git a/tests/runwsgi.py b/tests/runwsgi.py
+index f419d7c..242ef1d 100644
+--- a/tests/runwsgi.py
++++ b/tests/runwsgi.py
+@@ -11,6 +11,10 @@
+
+ class Server(bottle.WSGIRefServer):
+ def run(self, handler): # pragma: no cover
++ self.srv = self.make_server(handler)
++ self.serve()
++
++ def make_server(self, handler):
+ from wsgiref.simple_server import make_server, WSGIRequestHandler
+ if self.quiet:
+ base = self.options.get('handler_class', WSGIRequestHandler)
+@@ -18,7 +22,10 @@ class QuietHandler(base):
+ def log_request(*args, **kw):
+ pass
+ self.options['handler_class'] = QuietHandler
+- self.srv = make_server(self.host, self.port, handler, **self.options)
++ srv = make_server(self.host, self.port, handler, **self.options)
++ return srv
++
++ def serve(self):
+ if sys.version_info[0] == 2 and sys.version_info[1] < 6:
+ # python 2.5 has no poll_interval
+ # and thus no way to stop the server
+@@ -27,20 +34,21 @@ def log_request(*args, **kw):
+ else:
+ self.srv.serve_forever(poll_interval=0.1)
+
+-class SslServer(bottle.CherryPyServer):
+- def run(self, handler):
+- import cherrypy.wsgiserver, cherrypy.wsgiserver.ssl_builtin
+- server = cherrypy.wsgiserver.CherryPyWSGIServer((self.host, self.port), handler)
++# http://www.socouldanyone.com/2014/01/bottle-with-ssl.html
++# https://github.com/mfm24/miscpython/blob/master/bottle_ssl.py
++class SslServer(Server):
++ def run(self, handler): # pragma: no cover
++ self.srv = self.make_server(handler)
++
++ import ssl
+ cert_dir = os.path.join(os.path.dirname(__file__), 'certs')
+- ssl_adapter = cherrypy.wsgiserver.ssl_builtin.BuiltinSSLAdapter(
+- os.path.join(cert_dir, 'server.crt'),
+- os.path.join(cert_dir, 'server.key'),
+- )
+- server.ssl_adapter = ssl_adapter
+- try:
+- server.start()
+- finally:
+- server.stop()
++ self.srv.socket = ssl.wrap_socket(
++ self.srv.socket,
++ keyfile=os.path.join(cert_dir, 'server.key'),
++ certfile=os.path.join(cert_dir, 'server.crt'),
++ server_side=True)
++
++ self.serve()
+
+ def start_bottle_server(app, port, server, **kwargs):
+ server_thread = ServerThread(app, port, server, kwargs)
+
diff --git a/dev-python/pycurl/pycurl-7.19.3.1.ebuild b/dev-python/pycurl/pycurl-7.19.3.1.ebuild
index 7e7f3f87fc1f..9ae75d00ee11 100644
--- a/dev-python/pycurl/pycurl-7.19.3.1.ebuild
+++ b/dev-python/pycurl/pycurl-7.19.3.1.ebuild
@@ -1,7 +1,6 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-python/pycurl/pycurl-7.19.3.1.ebuild,v 1.4 2014/06/15 15:22:12 mgorny Exp $
-
+# $Header: /var/cvsroot/gentoo-x86/dev-python/pycurl/pycurl-7.19.3.1.ebuild,v 1.5 2014/06/28 10:51:59 idella4 Exp $
EAPI=5
# The selftests fail with pypy, and urlgrabber segfaults for me.
@@ -15,8 +14,8 @@ SRC_URI="http://pycurl.sourceforge.net/download/${P}.tar.gz"
LICENSE="LGPL-2.1"
SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
-IUSE="curl_ssl_gnutls curl_ssl_nss +curl_ssl_openssl examples ssl"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~mips ~ppc ~ppc64 ~sparc ~s390 ~sh ~x86 ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE="curl_ssl_gnutls curl_ssl_nss +curl_ssl_openssl examples ssl test"
# Depend on a curl with curl_ssl_* USE flags.
# libcurl must not be using an ssl backend we do not support.
@@ -24,14 +23,17 @@ IUSE="curl_ssl_gnutls curl_ssl_nss +curl_ssl_openssl examples ssl"
# If curl uses gnutls, depend on at least gnutls 2.11.0 so that pycurl
# does not need to initialize gcrypt threading and we do not need to
# explicitly link to libgcrypt.
-DEPEND=">=net-misc/curl-7.25.0-r1[ssl=]
+RDEPEND=">=net-misc/curl-7.25.0-r1[ssl=]
ssl? (
net-misc/curl[curl_ssl_gnutls(-)=,curl_ssl_nss(-)=,curl_ssl_openssl(-)=,-curl_ssl_axtls(-),-curl_ssl_cyassl(-),-curl_ssl_polarssl(-)]
- curl_ssl_gnutls? ( >=net-libs/gnutls-2.11.0 )
- )"
-RDEPEND="${DEPEND}"
-# Tests have new deps that can never be keyworded, for now
-RESTRICT="test"
+ curl_ssl_gnutls? ( >=net-libs/gnutls-2.11.0 ) )"
+DEPEND="${RDEPEND}
+ test? ( dev-python/nose[${PYTHON_USEDEP}]
+ dev-python/bottle[${PYTHON_USEDEP}] )"
+# Needed for individual runs of testsuite by python impls.
+DISTUTILS_IN_SOURCE_BUILD=1
+
+PATCHES=( "${FILESDIR}"/${P}-ssl-test.patch )
python_prepare_all() {
sed -e "/data_files=/d" -i setup.py || die
@@ -56,11 +58,7 @@ src_test() {
python_test() {
# https://github.com/pycurl/pycurl/issues/180
- if [[ "${EPYTHON}" == python2.7 ]]; then
- sed -e 's:test_request_with_certinfo:_&:' \
- -e 's:test_request_without_certinfo:_&:' \
- -i tests/certinfo_test.py || die
- elif [[ "${EPYTHON}" == python3.4 ]]; then
+ if [[ "${EPYTHON}" == python3.4 ]]; then
sed -e 's:test_post_buffer:_&:' \
-e 's:test_post_file:_&:' \
-i tests/post_test.py || die