diff options
| author | root <root@alpha.trunkmasters.com> | 2026-07-04 03:04:33 -0500 |
|---|---|---|
| committer | root <root@alpha.trunkmasters.com> | 2026-07-04 03:04:33 -0500 |
| commit | d5f9077fde66bffd2bc6d193ae7c967e352a5562 (patch) | |
| tree | 7f4e638af1165dc34e405c5ff1f860f3e0c6c4f4 /dev-python/pyquery | |
| parent | 5f7788dcac066b42562f59afc4b79d7ed272bfcc (diff) | |
| download | baldeagleos-repo-d5f9077fde66bffd2bc6d193ae7c967e352a5562.tar.gz baldeagleos-repo-d5f9077fde66bffd2bc6d193ae7c967e352a5562.tar.xz baldeagleos-repo-d5f9077fde66bffd2bc6d193ae7c967e352a5562.zip | |
Adding metadata
Diffstat (limited to 'dev-python/pyquery')
| -rw-r--r-- | dev-python/pyquery/files/pyquery-2.0.1-newer-pythons.patch | 181 | ||||
| -rw-r--r-- | dev-python/pyquery/pyquery-2.0.1-r1.ebuild | 47 |
2 files changed, 228 insertions, 0 deletions
diff --git a/dev-python/pyquery/files/pyquery-2.0.1-newer-pythons.patch b/dev-python/pyquery/files/pyquery-2.0.1-newer-pythons.patch new file mode 100644 index 000000000000..5d1f7b97f00a --- /dev/null +++ b/dev-python/pyquery/files/pyquery-2.0.1-newer-pythons.patch @@ -0,0 +1,181 @@ +https://github.com/gawel/pyquery/commit/ce3ad507fd89c581bdd7aa086e96590e1f124277 + +From ce3ad507fd89c581bdd7aa086e96590e1f124277 Mon Sep 17 00:00:00 2001 +From: Gael Pasgrimaud <gael@gawel.org> +Date: Wed, 18 Feb 2026 21:06:19 +0100 +Subject: [PATCH] drop support for py3.9/3.10 + +--- + pyquery/pyquery.py | 8 +++++--- + setup.py | 3 +-- + tests/test_pyquery.py | 23 +++++++++++++---------- + tox.ini | 6 +++--- + 6 files changed, 27 insertions(+), 23 deletions(-) + +diff --git a/pyquery/pyquery.py b/pyquery/pyquery.py +index 5b05681..53aeaac 100644 +--- a/pyquery/pyquery.py ++++ b/pyquery/pyquery.py +@@ -1004,7 +1004,7 @@ def val(self, value=no_default): + def _get_value(tag): + # <textarea> + if tag.tag == 'textarea': +- return self._copy(tag).html() ++ return self._copy(tag).html(escape=False) + # <select> + elif tag.tag == 'select': + if 'multiple' in tag.attrib: +@@ -1097,7 +1097,9 @@ def html(self, value=no_default, **kwargs): + return None + tag = self[0] + children = tag.getchildren() +- html = escape(tag.text or '', quote=False) ++ html = tag.text or '' ++ if kwargs.pop('escape', True): ++ html = escape(html, quote=False) + if not children: + return html + if 'encoding' not in kwargs: +@@ -1188,7 +1190,7 @@ def text(self, value=no_default, **kwargs): + if not self: + return '' + return ' '.join( +- self._copy(tag).html() if tag.tag == 'textarea' else ++ self._copy(tag).html(escape=False) if tag.tag == 'textarea' else + extract_text(tag, **kwargs) for tag in self + ) + +diff --git a/setup.py b/setup.py +index 9c54b0e..f32f066 100644 +--- a/setup.py ++++ b/setup.py +@@ -49,10 +49,9 @@ def read(*names): + "Intended Audience :: Developers", + "Development Status :: 5 - Production/Stable", + "Programming Language :: Python :: 3", +- "Programming Language :: Python :: 3.9", +- "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ++ "Programming Language :: Python :: 3.13", + ], + keywords='jquery html xml scraping', + author='Olivier Lauzanne', +diff --git a/tests/test_pyquery.py b/tests/test_pyquery.py +index df6e3b8..b8ee3c8 100644 +--- a/tests/test_pyquery.py ++++ b/tests/test_pyquery.py +@@ -11,6 +11,8 @@ + from webtest.debugapp import debug_app + from unittest import TestCase + ++import pytest ++ + sys.path.insert(0, os.path.dirname(os.path.dirname(__file__))) + + +@@ -534,10 +536,9 @@ def test_val_for_textarea(self): + self.assertEqual(d('#textarea-multi').val(), multi_expected) + self.assertEqual(d('#textarea-multi').text(), multi_expected) + multi_new = '''Bacon\n<b>Eggs</b>\nSpam''' +- multi_new_expected = '''Bacon\n<b>Eggs</b>\nSpam''' + d('#textarea-multi').val(multi_new) +- self.assertEqual(d('#textarea-multi').val(), multi_new_expected) +- self.assertEqual(d('#textarea-multi').text(), multi_new_expected) ++ self.assertEqual(d('#textarea-multi').val(), multi_new) ++ self.assertEqual(d('#textarea-multi').text(), multi_new) + + def test_val_for_select(self): + d = pq(self.html4) +@@ -784,6 +785,7 @@ def test_make_link(self): + 'http://example.com/path_info') + + ++@pytest.mark.skipif(os.name == 'nt', reason='fail on windows') + class TestHTMLParser(TestCase): + xml = "<div>I'm valid XML</div>" + html = '''<div class="portlet"> +@@ -802,7 +804,7 @@ def test_replaceWith(self): + expected = '''<div class="portlet"> + <a href="/toto">TestimageMy link text</a> + <a href="/toto2">imageMy link text 2</a> +- Behind you, a three-headed HTML&dash;Entity! ++ Behind you, a three-headed HTML‐Entity! + </div>''' + d = pq(self.html) + d('img').replace_with('image') +@@ -813,7 +815,7 @@ def test_replaceWith_with_function(self): + expected = '''<div class="portlet"> + TestimageMy link text + imageMy link text 2 +- Behind you, a three-headed HTML&dash;Entity! ++ Behind you, a three-headed HTML‐Entity! + </div>''' + d = pq(self.html) + d('a').replace_with(lambda i, e: pq(e).html()) +@@ -899,14 +901,14 @@ def test_get(self): + d = pq(url=self.application_url, data={'q': 'foo'}, + method='get') + print(d) +- self.assertIn('REQUEST_METHOD: GET', d('p').text()) +- self.assertIn('q=foo', d('p').text()) ++ self.assertIn('REQUEST_METHOD: GET', d.text()) ++ self.assertIn('q=foo', d.text()) + + def test_post(self): + d = pq(url=self.application_url, data={'q': 'foo'}, + method='post') +- self.assertIn('REQUEST_METHOD: POST', d('p').text()) +- self.assertIn('q=foo', d('p').text()) ++ self.assertIn('REQUEST_METHOD: POST', d.text()) ++ self.assertIn('q=foo', d.text()) + + def test_session(self): + if HAS_REQUEST: +@@ -915,7 +917,7 @@ def test_session(self): + session.headers.update({'X-FOO': 'bar'}) + d = pq(url=self.application_url, data={'q': 'foo'}, + method='get', session=session) +- self.assertIn('HTTP_X_FOO: bar', d('p').text()) ++ self.assertIn('HTTP_X_FOO: bar', d.text()) + else: + self.skipTest('no requests library') + +@@ -925,6 +927,7 @@ def tearDown(self): + + class TestWebScrappingEncoding(TestCase): + ++ @pytest.mark.skip('No longer possible to query this url') + def test_get(self): + d = pq(url='http://ru.wikipedia.org/wiki/Заглавная_страница', + method='get') +diff --git a/tox.ini b/tox.ini +index 8f206df..7455adf 100644 +--- a/tox.ini ++++ b/tox.ini +@@ -1,5 +1,5 @@ + [tox] +-envlist=py38,py39,py310,py311,py312 ++envlist=py311,py312 + + [testenv] + whitelist_externals= +@@ -15,7 +15,7 @@ deps = + [testenv:lint] + skipsdist=true + skip_install=true +-basepython = python3.11 ++basepython = python3.12 + commands = + ruff check + deps = +@@ -24,7 +24,7 @@ deps = + [testenv:docs] + skip_install=false + skipsdist=true +-basepython = python3.11 ++basepython = python3.12 + changedir = docs + deps = + sphinx + diff --git a/dev-python/pyquery/pyquery-2.0.1-r1.ebuild b/dev-python/pyquery/pyquery-2.0.1-r1.ebuild new file mode 100644 index 000000000000..cfb08450ddef --- /dev/null +++ b/dev-python/pyquery/pyquery-2.0.1-r1.ebuild @@ -0,0 +1,47 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{13..14} ) + +inherit distutils-r1 optfeature pypi + +DESCRIPTION="A jQuery-like library for python" +HOMEPAGE=" + https://github.com/gawel/pyquery/ + https://pypi.org/project/pyquery/ +" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-macos" + +RDEPEND=" + >=dev-python/lxml-2.1[${PYTHON_USEDEP}] + >=dev-python/cssselect-1.2.0[${PYTHON_USEDEP}] +" +DEPEND=" + test? ( + dev-python/beautifulsoup4[${PYTHON_USEDEP}] + dev-python/requests[${PYTHON_USEDEP}] + dev-python/webtest[${PYTHON_USEDEP}] + dev-python/webob[${PYTHON_USEDEP}] + ) +" + +PATCHES=( + "${FILESDIR}"/${PN}-2.0.1-newer-pythons.patch +) + +EPYTEST_DESELECT=( + # needs network + tests/test_pyquery.py::TestWebScrappingEncoding::test_get +) +EPYTEST_PLUGINS=() +distutils_enable_tests pytest + +pkg_postinst() { + optfeature "Support for BeautifulSoup3 as a parser backend" dev-python/beautifulsoup4 +} |
