forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Package-Manager: portage-2.2.27 Signed-off-by: Justin Lecher <[email protected]>
- Loading branch information
Showing
2 changed files
with
115 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
DIST urllib3-1.12.tar.gz 151072 SHA256 0ea512776971fe4e76192600fe41e4e7ee96b4b9a5b15aefc1ac31d2a63872c6 SHA512 44f1cf9c5d5538e35d026551a2d1dc7119786c1148b9a769fa9f652f0368e996512962c6245c92d1f4bb1d8e816e2fb0ffebeb0060b01f92b2a5d6e01d15426f WHIRLPOOL d386e4fb47b2ea4d78d2ad690c9252d6be1b3f5a624e20670e22c9b3a28dc910e3d5ecd24ca54d8f8337f8e9a9875208efce06952cd392d9c8254257eadeee70 | ||
DIST urllib3-1.13.1.tar.gz 156259 SHA256 6eba1d713f8552e37ac4081c6bdf7be9f5a79f58447aed762bf24cc34c5e3983 SHA512 663c0a10b0e6b8a2c337cf799e45b8d949cbf0f542e22204fe31af193c7275c499ddf0ac3470152cc51bed56a0f5b77f1897140801b732773f606e77e8cea420 WHIRLPOOL d0c3ea06f7a8180eca9b22197ddad6f04ea9b9c5fe254ade00e12fb9a5ffeaa9264a5a160cc49ebd87a1822ba13af22bef357a241b7b76b2281f400f776e309e | ||
DIST urllib3-1.14.tar.gz 161497 SHA256 dd4fb13a4ce50b18338c7e4d665b21fd38632c5d4b1d9f1a1379276bd3c08d37 SHA512 8c315b442bc7454e421f2c801cc2bbfc011fb2eb5dcbd2ff7d6078dab0bb5254e3e1489496758cec190ebd0c249962fa1fe24fe6535e844a681350e9d7353562 WHIRLPOOL 3be475d5591328d304bbf48392ab563a7d5013907c96298abaf34b06a7a16fe81d56a03f6a73d50c9679334b140f00789a71a918f2ea1e6951e5351324852f3c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
# Copyright 1999-2016 Gentoo Foundation | ||
# Distributed under the terms of the GNU General Public License v2 | ||
# $Id$ | ||
|
||
EAPI=6 | ||
|
||
PYTHON_COMPAT=( python2_7 python3_{3,4,5} pypy ) | ||
PYTHON_REQ_USE="ssl(+)" | ||
|
||
inherit distutils-r1 | ||
|
||
DESCRIPTION="HTTP library with thread-safe connection pooling, file post, and more" | ||
HOMEPAGE="https://github.com/shazow/urllib3" | ||
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" | ||
|
||
LICENSE="MIT" | ||
SLOT="0" | ||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" | ||
IUSE="doc test" | ||
|
||
RDEPEND=" | ||
dev-python/PySocks[${PYTHON_USEDEP}] | ||
dev-python/certifi[${PYTHON_USEDEP}] | ||
dev-python/six[${PYTHON_USEDEP}] | ||
>=dev-python/pyopenssl-0.13[${PYTHON_USEDEP}] | ||
$(python_gen_cond_dep 'dev-python/backports-ssl-match-hostname[${PYTHON_USEDEP}]' python2_7 pypy) | ||
$(python_gen_cond_dep 'dev-python/ndg-httpsclient[${PYTHON_USEDEP}]' python2_7 pypy) | ||
$(python_gen_cond_dep 'dev-python/pyasn1[${PYTHON_USEDEP}]' python2_7 pypy) | ||
" | ||
DEPEND=" | ||
dev-python/setuptools[${PYTHON_USEDEP}] | ||
test? ( | ||
${RDEPEND} | ||
>=www-servers/tornado-4.2.1[$(python_gen_usedep 'python*')] | ||
>=dev-python/mock-1.3.0[${PYTHON_USEDEP}] | ||
>=dev-python/nose-1.3.7[${PYTHON_USEDEP}] | ||
>=dev-python/nose-exclude-0.4.1[${PYTHON_USEDEP}] | ||
) | ||
doc? ( dev-python/sphinx[${PYTHON_USEDEP}] ) | ||
" | ||
|
||
# Testsuite written requiring mock to be installed under all Cpythons | ||
|
||
PATCHES=( "${FILESDIR}"/${PN}-1.13.1-unbundle.patch ) | ||
|
||
python_prepare_all() { | ||
# Replace bundled copy of dev-python/six | ||
cat > urllib3/packages/six.py <<-EOF | ||
from __future__ import absolute_import | ||
from six import * | ||
EOF | ||
|
||
rm -r urllib3/packages/ssl_match_hostname || die | ||
cat > urllib3/packages/ssl_match_hostname.py <<- EOF | ||
from __future__ import absolute_import | ||
try: | ||
from backports.ssl_match_hostname import CertificateError, match_hostname | ||
except ImportError: | ||
from ssl import CertificateError, match_hostname | ||
EOF | ||
|
||
cat > urllib3/packages/ordered_dict.py <<- EOF | ||
from __future__ import absolute_import | ||
from collections import OrderedDict | ||
EOF | ||
|
||
sed \ | ||
-e 's:\.packages\.six:six:g' \ | ||
-e 's:\.six:six:g' \ | ||
-i urllib3/util/response.py urllib3/response.py || die | ||
|
||
sed -i '/cover-min-percentage/d' setup.cfg || die | ||
# Fix tests | ||
sed -i 's/urllib3.packages.six/six/' test/test_retry.py || die | ||
|
||
# Reset source of objects.inv | ||
if use doc; then | ||
local PYTHON_DOC_ATOM=$(best_version --host-root dev-python/python-docs:2.7) | ||
local PYTHON_DOC_VERSION="${PYTHON_DOC_ATOM#dev-python/python-docs-}" | ||
local PYTHON_DOC="/usr/share/doc/python-docs-${PYTHON_DOC_VERSION}/html" | ||
local PYTHON_DOC_INVENTORY="${PYTHON_DOC}/objects.inv" | ||
sed \ | ||
-e "s|'python': ('http://docs.python.org/2.7', None|'${PYTHON_DOC}': ('${PYTHON_DOC_INVENTORY}'|" \ | ||
-i docs/conf.py || die | ||
fi | ||
|
||
distutils-r1_python_prepare_all | ||
} | ||
|
||
python_compile_all() { | ||
use doc && emake -C docs html | ||
} | ||
|
||
python_test() { | ||
# Failures still occur under py2.7. | ||
# https://github.com/shazow/urllib3/issues/621 | ||
|
||
[[ "${EPYTHON}" == pypy ]] && return | ||
|
||
nosetests -v \ | ||
--exclude test_headerdict \ | ||
--exclude test_headers \ | ||
--exclude test_source_address_error \ | ||
--exclude test_no_ssl \ | ||
--exclude test_ca_dir_verified \ | ||
--exclude test_verified \ | ||
test || die "Tests fail with ${EPYTHON}" | ||
} | ||
|
||
python_install_all() { | ||
use doc && local HTML_DOCS=( docs/_build/html/. ) | ||
|
||
distutils-r1_python_install_all | ||
} |