Gentoo Archives: gentoo-commits

From: Patrick McLean <chutzpah@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pyquery/, dev-python/pyquery/files/
Date: Wed, 27 Nov 2019 21:21:56
Message-Id: 1574889565.6bffbaa88d34c8a195854b5084ddb86a1f7a0cd6.chutzpah@gentoo
1 commit: 6bffbaa88d34c8a195854b5084ddb86a1f7a0cd6
2 Author: Patrick McLean <patrick.mclean <AT> sony <DOT> com>
3 AuthorDate: Wed Nov 27 19:37:07 2019 +0000
4 Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
5 CommitDate: Wed Nov 27 21:19:25 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6bffbaa8
7
8 dev-python/pyquery-1.4.1: bump, add py38 and pypy{,3}
9
10 Copyright: Sony Interactive Entertainment Inc.
11 Package-Manager: Portage-2.3.79, Repoman-2.3.18
12 Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
13
14 dev-python/pyquery/Manifest | 1 +
15 .../files/pyquery-1.4.1-network-tests.patch | 20 +++++++++
16 .../pyquery/files/pyquery-1.4.1-tests-pypy.patch | 20 +++++++++
17 dev-python/pyquery/pyquery-1.4.1.ebuild | 47 ++++++++++++++++++++++
18 4 files changed, 88 insertions(+)
19
20 diff --git a/dev-python/pyquery/Manifest b/dev-python/pyquery/Manifest
21 index b462127aec0..49db60200e9 100644
22 --- a/dev-python/pyquery/Manifest
23 +++ b/dev-python/pyquery/Manifest
24 @@ -1,2 +1,3 @@
25 DIST pyquery-1.2.13.tar.gz 44032 BLAKE2B df257c6116b3f8804627a0b4a6556445c644410acdf008fe9afd08136a0a7f47d66b99071cce61a1569853ec9c3c38d20ca66aec0950532e94949b36d4814c3e SHA512 39a2bfe6f1eaefb6d1a78f73e5bdb4d12a9e223b26f6aff0f979ceaa68005ab08e41bdf11fe808489d22e0506e558621982dc59fa2164cd1e3d8168b0ef8ceb6
26 DIST pyquery-1.4.0.tar.gz 45215 BLAKE2B cb748c09524f6cc6b22c9712370da754495c31b159a44f02e9b5f00e4e94295d7259d224e63066297e6efd74f0b43a508a56d1df4f4150727cd261b959402e9a SHA512 523bc058fc93332b13840a7249bce5a449b0029f6434043a739a2f24abdd89efb314da8795f1b2be2d7e4464a8e4bdf6b061d768b895d0dd1630f44ee341f37f
27 +DIST pyquery-1.4.1.tar.gz 47983 BLAKE2B eb8d0ca59122734a4c715c33f40fd0b5fcc8edcabe9e41649ddf332feb1df603f8527a668aa7b9d78974b3d049e774355296644abd9b4d426d96e6e3c7a74065 SHA512 e2bfbbf51f99a408e9696a2b9c15f8875813847a10b5bd93c4c7a6886ac1b3ae6c7883ec4fb64e9bccab2127617843961e181044fe927f3c80c8ac363ed86141
28
29 diff --git a/dev-python/pyquery/files/pyquery-1.4.1-network-tests.patch b/dev-python/pyquery/files/pyquery-1.4.1-network-tests.patch
30 new file mode 100644
31 index 00000000000..37664689c0f
32 --- /dev/null
33 +++ b/dev-python/pyquery/files/pyquery-1.4.1-network-tests.patch
34 @@ -0,0 +1,20 @@
35 +diff --git a/tests/test_pyquery.py b/tests/test_pyquery.py
36 +index ca38a83..d29b27b 100644
37 +--- a/tests/test_pyquery.py
38 ++++ b/tests/test_pyquery.py
39 +@@ -6,6 +6,7 @@
40 + import os
41 + import sys
42 + import time
43 ++import unittest
44 + from lxml import etree
45 + from pyquery.pyquery import PyQuery as pq, no_default
46 + from pyquery.openers import HAS_REQUEST
47 +@@ -889,6 +890,7 @@ class TestWebScrapping(TestCase):
48 +
49 + class TestWebScrappingEncoding(TestCase):
50 +
51 ++ @unittest.skip("needs internet")
52 + def test_get(self):
53 + d = pq(u'http://ru.wikipedia.org/wiki/Заглавная_страница',
54 + method='get')
55
56 diff --git a/dev-python/pyquery/files/pyquery-1.4.1-tests-pypy.patch b/dev-python/pyquery/files/pyquery-1.4.1-tests-pypy.patch
57 new file mode 100644
58 index 00000000000..f5f160a138d
59 --- /dev/null
60 +++ b/dev-python/pyquery/files/pyquery-1.4.1-tests-pypy.patch
61 @@ -0,0 +1,20 @@
62 +diff --git a/tests/test_pyquery.py b/tests/test_pyquery.py
63 +index d29b27b..e6a9230 100644
64 +--- a/tests/test_pyquery.py
65 ++++ b/tests/test_pyquery.py
66 +@@ -7,6 +7,7 @@ import os
67 + import sys
68 + import time
69 + import unittest
70 ++import platform
71 + from lxml import etree
72 + from pyquery.pyquery import PyQuery as pq, no_default
73 + from pyquery.openers import HAS_REQUEST
74 +@@ -33,6 +34,7 @@ path_to_invalid_file = os.path.join(dirname, 'invalid.xml')
75 +
76 + class TestUnicode(TestCase):
77 +
78 ++ @unittest.skipIf(sys.hexversion > 0x3000000 and 'pypy' in platform.python_implementation().lower(), "broken on pypy3")
79 + def test_unicode(self):
80 + xml = pq(u"<html><p>é</p></html>")
81 + self.assertEqual(type(xml.html()), text_type)
82
83 diff --git a/dev-python/pyquery/pyquery-1.4.1.ebuild b/dev-python/pyquery/pyquery-1.4.1.ebuild
84 new file mode 100644
85 index 00000000000..ddcfe184a05
86 --- /dev/null
87 +++ b/dev-python/pyquery/pyquery-1.4.1.ebuild
88 @@ -0,0 +1,47 @@
89 +# Copyright 1999-2019 Gentoo Authors
90 +# Distributed under the terms of the GNU General Public License v2
91 +
92 +EAPI=7
93 +
94 +PYTHON_COMPAT=( python2_7 python3_{5,6,7,8} pypy{,3} )
95 +
96 +inherit distutils-r1 eutils
97 +
98 +DESCRIPTION="A jQuery-like library for python"
99 +HOMEPAGE="https://github.com/gawel/pyquery"
100 +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
101 +
102 +LICENSE="BSD"
103 +SLOT="0"
104 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc64 ~s390 ~sh ~sparc ~x86"
105 +IUSE="test"
106 +
107 +RDEPEND="
108 + >=dev-python/lxml-2.1[${PYTHON_USEDEP}]
109 + >dev-python/cssselect-0.7.9[${PYTHON_USEDEP}]
110 + >=dev-python/webob-1.1.9[${PYTHON_USEDEP}]"
111 +DEPEND="
112 + dev-python/setuptools[${PYTHON_USEDEP}]
113 + test? ( ${RDEPEND}
114 + dev-python/beautifulsoup[${PYTHON_USEDEP}]
115 + dev-python/requests[${PYTHON_USEDEP}]
116 + dev-python/nose[${PYTHON_USEDEP}]
117 + dev-python/webtest[${PYTHON_USEDEP}]
118 + $(python_gen_cond_dep 'dev-python/restkit[${PYTHON_USEDEP}]' 'python2_7')
119 + )"
120 +
121 +RESTRICT+=" !test? ( test )"
122 +
123 +PATCHES=(
124 + "${FILESDIR}/pyquery-1.4.1-network-tests.patch"
125 + "${FILESDIR}/pyquery-1.4.1-tests-pypy.patch"
126 +)
127 +
128 +python_test() {
129 + # The suite, it appears, requires this hard setting of PYTHONPATH!
130 + PYTHONPATH=. nosetests || die "Tests fail with ${EPYTHON}"
131 +}
132 +
133 +pkg_postinst() {
134 + optfeature "Support for BeautifulSoup3 as a parser backend" dev-python/beautifulsoup
135 +}