# # spec file for package python-html5lib # # Copyright (c) 2023 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/ # %{?!python_module:%define python_module() python-%{**} python3-%{**}} %{?sle15_python_module_pythons} Name: python-html5lib Version: 1.1 Release: 5.10 Summary: HTML parser based on the WHAT-WG Web Applications 1 License: MIT URL: https://github.com/html5lib/html5lib-python Source: https://files.pythonhosted.org/packages/source/h/html5lib/html5lib-%{version}.tar.gz # PATCH-FIX_UPSTREAM https://github.com/html5lib/html5lib-python/commit/2c19b9899ab3a3e8bd0ca35e5d78544334204169 Use Node.from_parent() constructor to support pytest 6 Patch0: pytest6.patch # https://github.com/html5lib/html5lib-python/issues/541 Patch1: python-html5lib-no-mock.patch # PATCH-FIX-UPSTREAM https://github.com/html5lib/html5lib-python/pull/570 adapt testsuite to changes in pytest 7.4 Patch2: pytest74.patch BuildRequires: %{python_module Genshi} BuildRequires: %{python_module lxml} BuildRequires: %{python_module pytest >= 4.0} BuildRequires: %{python_module pytest-expect} BuildRequires: %{python_module setuptools >= 18.5} BuildRequires: %{python_module six >= 1.9} BuildRequires: %{python_module webencodings} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-six >= 1.9 Requires: python-webencodings Recommends: python-Genshi Recommends: python-lxml BuildArch: noarch %python_subpackages %description HTML parser designed to follow the HTML5 specification. The parser is designed to handle all flavours of HTML and parses invalid documents using well-defined error handling rules compatible with the behaviour of major desktop web browsers. Output is to a tree structure; the current release supports output to DOM, ElementTree, lxml and BeautifulSoup tree formats as well as a simple custom format %prep %setup -q -n html5lib-%{version} %autopatch -p1 %build %python_build %install %python_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %check %pytest --tb=short %files %{python_files} %license LICENSE %doc CHANGES.rst README.rst %{python_sitelib}/html5lib/ %{python_sitelib}/html5lib-%{version}-py%{python_version}.egg-info %changelog * Thu Jul 27 2023 Markéta Machová - Add pytest74.patch to fix tests with pytest 7.4+ * Fri Apr 21 2023 Dirk Müller - add sle15_python_module_pythons (jsc#PED-68) * Thu Apr 13 2023 Matej Cepl - Make calling of %%{sle15modernpython} optional. * Thu Jul 14 2022 Steve Kowalik - Remove BuildRequires on mock. * Mon Mar 21 2022 pgajdos@suse.com - do not require python-mock for build - added patches fix https://github.com/html5lib/html5lib-python/issues/541 + python-html5lib-no-mock.patch * Thu Aug 27 2020 Marketa Calabkova - Update to 1.1 * Drop support for Python 3.3 and 3.4. * Try to import from ``collections.abc`` to remove DeprecationWarning and ensure ``html5lib`` keeps working in future Python versions. (#403) * Drop optional ``datrie`` dependency. (#442) - Drop merged patches: * pytest4-mhroncok.patch * collections-abc.patch * pytest5.patch - Add upstream patch pytest6.patch * Fri May 29 2020 Tomáš Chvátal - Add patch to fix run with pytest5: * pytest5.patch * Wed May 6 2020 Tomáš Chvátal - Add patch to not collide with collections deprecation: * collections-abc.patch * Wed Jan 15 2020 Tomáš Chvátal - Restrict pytest to < 5.0 as it broke with 5.3 and upstream still didn't bother to merge support for even pytest 4+... * Tue Dec 3 2019 Tomáš Chvátal - Fix comments in the spec file * Fri Nov 1 2019 Matej Cepl - Add pytest4-mhroncok.patch by Miro Hroncok from gh#html5lib/html5lib-python#414 to make testsuite passing under pytest4+. * Mon Oct 14 2019 Matej Cepl - Replace %%fdupes with plain %%fdupes; hardlinks are better. * Fri Jul 19 2019 Tomáš Chvátal - Restrict pytest4 for now as upstream supports only 3 series at the moment * Tue Dec 4 2018 Matej Cepl - Remove superfluous devel dependency for noarch package * Wed Dec 13 2017 tchvatal@suse.com - Version update to latest 1.0.1 release: * Dropped support for py 2.6 * Documentation update * Fixes for python 3.7 and 3.6 * Tue Dec 5 2017 opensuse@dstoecker.de - update to 1.0b10 * Fri Apr 7 2017 toddrme2178@gmail.com - html5lib has a hard dependency on python-webencodings. It will fail at import time without it. * Tue Apr 4 2017 aloisio@gmx.com - Updated to version 0.999999999 (see CHANGES.rst) - Converted to single-spec - Dropped coerce_comments_to_work_with_lxml.patch (accepted upstream) * Fri Feb 12 2016 toddrme2178@gmail.com - Add coerce_comments_to_work_with_lxml.patch Fixes compatibility with python-lxml 3.5+, which adds validation for xml comments. Should be in next release/ - Re-enable tests. * Tue Feb 2 2016 toddrme2178@gmail.com - Disable broken tests. Check if they are working again in the next release. * Mon Feb 1 2016 toddrme2178@gmail.com - update to version 0.9999999: * Fix #195: fix the sanitizer to drop broken URLs (it threw an exception between 0.9999 and 0.999999). * Mon Aug 3 2015 tbechtold@suse.com - Relax python-lxml BuildRequires and Requires. html5lib should also work with older python-lxml modules. * Mon Jul 27 2015 aloisio@gmx.com - Update to version 0.999999 * Fix #189: fix the sanitizer to allow relative URLs again (as it did prior to 0.9999/1.0b5). - Aligned version requirements with PyPI * Fri Jul 24 2015 seife+obs@b1-systems.com - Fix non-SUSE build by conditionalizing Recommends: tags * Wed May 6 2015 benoit.monin@gmx.fr - update to version 0.99999: * Fix #188: fix the sanitizer to not throw an exception when sanitizing bogus data URLs. - additional changes from version 0.9999: * Fix #153: Sanitizer fails to treat some attributes as URLs. Despite how this sounds, this has no known security implications. No known version of IE (5.5 to current), Firefox (3 to current), Safari (6 to current), Chrome (1 to current), or Opera (12 to current) will run any script provided in these attributes. * Pass error message to the ParseError exception in strict parsing mode. * Allow data URIs in the sanitizer, with a whitelist of content-types. * Add support for Python implementations that don’t support lone surrogates (read: Jython). Fixes #2. * Remove localization of error messages. This functionality was totally unused (and untested that everything was localizable), so we may as well follow numerous browsers in not supporting translating technical strings. * Expose treewalkers.pprint as a public API. * Add a documentEncoding property to HTML5Parser, fix #121. - update project URL * Mon May 26 2014 hpj@urpla.net - update to 0.999 - Fix #127: add work-around for CPython issue #20007: .read(0) on http.client.HTTPResponse drops the rest of the content. - Fix #115: lxml treewalker can now deal with fragments containing, at their root level, text nodes with non-ASCII characters on Python 2. - enable tests and include test suite for further validations for distributions > 11.1 and SLES 10 * Tue Oct 22 2013 toddrme2178@gmail.com - Update to 0.99 * No changes, just updated version number - Add additional dependencies * Thu Mar 29 2012 saschpe@suse.de - Use upstream tarball - Don't install tests, but install README * Sat Feb 11 2012 alexandre@exatati.com.br - Update to 0.95: - Sorry, no changelog atm. - Regenerate spec file with py2pack. * Mon Jan 18 2010 alexandre@exatati.com.br - Update to 0.90. * Wed Oct 14 2009 alexandre@exatati.com.br - Initial package (0.11.1) for openSUSE.