# # spec file for package python-pyquery # # Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # %define skip_python2 1 %global flavor %{nil} %if "%{flavor}" == "test" %define psuffix -test %bcond_without test %else %define psuffix %{nil} %bcond_with test %endif %{?sle15_python_module_pythons} Name: python-pyquery%{psuffix} Version: 2.0.1 Release: 1.5 Summary: A jQuery-like library for python License: BSD-3-Clause URL: https://pypi.python.org/pypi/pyquery Source: https://files.pythonhosted.org/packages/source/p/pyquery/pyquery-%{version}.tar.gz # PATCH-FIX-OPENSUSE make_webtest_optional.patch mcepl@suse.com # Make it possible to run test suite (albeit partial) without WebTest module Patch0: make_webtest_optional.patch BuildRequires: %{python_module cssselect >= 1.2.0} BuildRequires: %{python_module lxml >= 2.1} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-cssselect >= 1.2.0 Requires: python-lxml >= 2.1 BuildArch: noarch %if %{with test} BuildRequires: %{python_module WebOb > 1.1.9} BuildRequires: %{python_module pytest} BuildRequires: %{python_module requests} %if 0%{?suse_version} > 1550 BuildRequires: %{python_module WebTest} %endif %endif %python_subpackages %description Pyquery allows you to make jQuery queries on XML documents. The API is as much as possible the similar to jQuery. Pyquery uses lxml for fast XML and HTML manipulation. %prep %autosetup -p1 -n pyquery-%{version} %build %python_build %install %if !%{with test} %python_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %endif %if %{with test} %check # Disable tests which perform live fetch # test_selector_html uses XML namespaces, which are broken with libxml2 2.10.4+ %pytest -k 'not (test_get or test_selector_html)' tests %endif %if !%{with test} %files %{python_files} %license LICENSE.txt %doc CHANGES.rst README.rst %{python_sitelib}/pyquery/ %{python_sitelib}/pyquery-%{version}*-info %endif %changelog * Fri Nov 15 2024 John Paul Adrian Glaubitz - Update to 2.0.1 * Breaking change: its seems no longer possible to use the html parser with a xml file so its no longer tested * Drop support for python 3.7 - Refresh make_webtest_optional.patch * Mon Apr 24 2023 Daniel Garcia - Update make_webtest_optional.patch to make the import optional in conftest.py * Fri Apr 21 2023 Dirk Müller - add sle15_python_module_pythons (jsc#PED-68) * Thu Apr 20 2023 Steve Kowalik - Update to 2.0.0: * Breaking change: inputs starting with "http://" or "https://" like PyQuery("http://example.com") will no longer fetch the contents of the URL. Users desiring the old behavior should switch to PyQuery(url="http://example.com"). * Add nextUntil method * .remove() no longer inserts a space in place of the removed element * Fix escaping of top-level element text in .html() output * Support (and require) cssselect 1.2+ * Drop support for python 3.5/3.6 * Thu Apr 13 2023 Matej Cepl - Make calling of %%{sle15modernpython} optional. * Fri Feb 17 2023 Matej Cepl - Add make_webtest_optional.patch to allow testing without WebTest module. * Fri Aug 19 2022 Ben Greiner - Remove coverage from build requirements -- not relevant for rpm package * Wed Mar 30 2022 Dirk Müller - update to 1.4.3: * No longer use a universal wheel * Fix exception raised when calling `PyQuery("").text()` * python2 is no longer supported * Sun Aug 16 2020 John Vandenberg - Replace nose with pytest * Sun Nov 24 2019 Arun Persaud - specfile: * be more specific in %%files section - update to version 1.4.1: * This is the latest release with py2 support * Remove py33, py34 support * web scraping improvements: default timeout and session support * Add API methods to serialize form-related elements according to spec * Include HTML markup when querying textarea text/value * Mon Feb 25 2019 Tomáš Chvátal - Use _multibuild to run tests * Mon Feb 25 2019 John Vandenberg - Add %%license - Run test suite on both Python 2 & 3 - Remove outdated build dependencies - Add minimum versions - Add python-coverage as build dependency as nose segfaults when missing * Tue Dec 4 2018 Matej Cepl - Remove superfluous devel dependency for noarch package * Mon Aug 13 2018 mcepl@suse.com - Remove dependency on unittest2 * Wed Mar 29 2017 alarrosa@suse.com - Converted to singlespec * Tue Oct 25 2016 arun@gmx.de - update to version 1.2.17: * PyQuery('').val() is '' * PyQuery('').val() is '' - changes from version 1.2.16: * .attr('value', '') no longer removes the value attribute * without value="..." have a .val() of 'on' * without value="..." have a .val() of 'on' *