# # spec file for package python-MarkupSafe # # Copyright (c) 2025 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/ # %global flavor %{nil} %if "%{flavor}" == "test" %define psuffix -%{flavor} %bcond_without test %else %define psuffix %{nil} %bcond_with test %endif %{?sle15_python_module_pythons} Name: python-MarkupSafe%{psuffix} Version: 2.1.5 Release: 3.3 Summary: Implements a XML/HTML/XHTML Markup safe string for Python License: BSD-3-Clause Group: Development/Languages/Python URL: https://github.com/pallets/markupsafe Source: https://files.pythonhosted.org/packages/source/M/MarkupSafe/MarkupSafe-%{version}.tar.gz BuildRequires: %{python_module devel} BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-base >= 3.6 %if %{with test} BuildRequires: %{python_module MarkupSafe >= %{version}} BuildRequires: %{python_module pytest} %endif %python_subpackages %description Implements a unicode subclass that supports HTML strings. This can be used to safely encode strings for dynamically generated web pages. %prep %autosetup -p1 -n MarkupSafe-%{version} # Upstream changed the Python package metadata to require Python 3.7, but the tests pass on Python 3.6. sed -i -e '/^python_requires =/s/3\.7/3\.6/' setup.cfg %build %if !%{with test} export CFLAGS="%{optflags}" %pyproject_wheel %endif %install %if !%{with test} %pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitearch} %python_expand rm %{buildroot}%{$python_sitearch}/markupsafe/_speedups.c %endif %if %{with test} %check %pytest_arch %endif %if !%{with test} %files %{python_files} %license LICENSE.rst %doc README.rst docs/ %{python_sitearch}/markupsafe/ %{python_sitearch}/MarkupSafe-%{version}.dist-info %endif %changelog * Thu Feb 20 2025 Dirk Müller - split test dependencies into a multibuild to break cycle with pytest * Wed Dec 4 2024 Matej Cepl - The test suite survives without ca-certificates-mozilla-prebuilt now, so we can remove BR (and avoid deadly cycles). * Thu Jul 11 2024 Dirk Müller - add buildignores to break buildcycle over p11-kit/dbus-1/systemd:mini/python-MarkupSafe * Sun Feb 4 2024 Dirk Müller - update to 2.1.5: * Fix striptags not collapsing spaces. :issue:`417` * Fri Jan 26 2024 Dirk Müller - update to 2.1.4: * Don't use regular expressions for striptags, avoiding a performance issue. :pr:`413` * Mon Jun 19 2023 Dirk Müller - update to 2.1.3: * Implement ``format_map``, ``casefold``, ``removeprefix``, and ``removesuffix`` methods. * Fix static typing for basic ``str`` methods on ``Markup``. * Use ``Self`` for annotating return types. :pr:`379` * 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. * Sun Jan 29 2023 Dirk Müller - update to 2.1.2: * Fix ``striptags`` not stripping tags containing newlines. * Fri Jun 24 2022 Manuel Jacob - Patch PKG-INFO to avoid pip failing on Python 3.6 with `ERROR: Package 'MarkupSafe' requires a different Python: 3.6.15 not in '>=3.7'`. * Thu Jun 9 2022 Andreas Schneider - Require python 3.6. There is no need to require a newer version and this way it builds on openSUSE Leap >= 15.3 * Fri Mar 18 2022 Arun Persaud - specfile: * update copyright year * require python >= 3.7 - update to version 2.1.1: * Avoid ambiguous regex matches in "striptags". :pr:`293` - changes from version 2.1.0: * Drop support for Python 3.6. :pr:`262` * Remove "soft_unicode", which was previously deprecated. Use "soft_str" instead. :pr:`261` * Raise error on missing single placeholder during string interpolation. :issue:`225` * Disable speedups module for GraalPython. :issue:`277` * Sun Jun 13 2021 Michael Ströder - skip building for Python 2.x * Tue Jun 1 2021 Antonio Larrosa - Update to v2.0.1 * Mark top-level names as exported so type checking understands imports in user projects. * Fix some types that weren’t available in Python 3.6.0. - Update to v2.0.0 * Drop Python 2.7, 3.4, and 3.5 support. * Markup.unescape uses html.unescape() to support HTML5 character references. #117 * Add type annotations for static typing tools. #149 * Fri Apr 16 2021 Dirk Müller - allow tests to be disabled (still on by default) * Tue Mar 5 2019 Tomáš Chvátal - Update to 1.1.1: * Fix segfault when __html__ method raises an exception when using the C speedups. The exception is now propagated correctly. (#109) * Thu Feb 21 2019 John Vandenberg - Update to v1.1.0 - Drop support for Python 2.6 and 3.3. - Build wheels for Linux, Mac, and Windows, allowing systems without a compiler to take advantage of the C extension speedups - Use newer CPython API on Python 3, resulting in a 1.5x speedup - ``escape`` wraps ``__html__`` result in ``Markup``, consistent with documented behavior - Switch to using pytest in %%check as setup.py test no longer works - Use more precise URL https://github.com/pallets/markupsafe - Add docs/ to %%doc, including the changelog - Remove AUTHORS from %%doc, removed upstream in 6247e015 * Mon Jan 14 2019 kukuk@suse.de - Use %%license instead of %%doc [bsc#1082318] * Tue Apr 4 2017 jmatejek@suse.com - update source url - fix obs/prov to refer to old python - drop _speedups.c from installed directory * Wed Mar 22 2017 tbechtold@suse.com - Add missing BuildRequires for python-rpm-macros * Wed Mar 22 2017 tbechtold@suse.com - update to 1.0.0 + No upstream changelog - Switch to singlespec approach * Tue Jul 15 2014 toddrme2178@gmail.com - Update to 0.23 + No upstream changelog * Thu May 8 2014 toddrme2178@gmail.com - Update to 0.21 + No upstream changelog - ------------------------------------------------------------------ * Thu Mar 13 2014 mcihar@suse.cz - update to 0.19: + Various Python 3.x fixes * Thu Oct 24 2013 speilicke@suse.com - Require python-setuptools instead of distribute (upstreams merged) * Tue Jun 25 2013 dmueller@suse.com - update to 0.18: + Fixed interpolation on tuples + Varios Python 3.x fixes * Wed May 23 2012 highwaystar.ru@gmail.com - python3 package added - minor spec improvement * Thu Sep 8 2011 andrea.turrini@gmail.com - Fixed typo in description of python-MarkupSafe.spec * Thu Sep 1 2011 saschpe@suse.de - Update to 0.15 - Changed license to BSD-3-Clause - Renamed to python-MarkupSafe (from python-markupsafe) * Mon Aug 30 2010 jfunk@funktronics.ca - Update to 0.11 Since MarkupSafe 0.10 there is now also a separate escape function called `escape_silent` that returns an empty string for `None` for consistency with other systems that return empty strings for `None` when escaping (for instance Pylons' webhelpers). * Thu Jul 1 2010 jfunk@funktronics.ca - Initial release