diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..fcc7b97 --- /dev/null +++ b/_multibuild @@ -0,0 +1,3 @@ + + test + diff --git a/markdown-3.0-python37.patch b/markdown-3.0-python37.patch index 98a80bd..483a7b0 100644 --- a/markdown-3.0-python37.patch +++ b/markdown-3.0-python37.patch @@ -1,6 +1,10 @@ ---- Markdown-3.0/tests/test_legacy.py.orig 2018-10-18 20:59:01.521952070 +0200 -+++ Markdown-3.0/tests/test_legacy.py 2018-10-18 20:59:20.746395446 +0200 -@@ -29,6 +29,7 @@ +--- + tests/test_legacy.py | 1 + + 1 file changed, 1 insertion(+) + +--- a/tests/test_legacy.py ++++ b/tests/test_legacy.py +@@ -28,6 +28,7 @@ warnings.simplefilter('error') # Except for the warnings that shouldn't warnings.filterwarnings('default', category=PendingDeprecationWarning) warnings.filterwarnings('default', category=DeprecationWarning, module='markdown') diff --git a/python-Markdown.changes b/python-Markdown.changes index 2282f7b..442a37a 100644 --- a/python-Markdown.changes +++ b/python-Markdown.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Aug 12 14:47:54 UTC 2024 - Matej Cepl + +- Split the package into multibuild with tests separate (to + separate PyYAML dependency). + ------------------------------------------------------------------- Fri Mar 15 19:46:03 UTC 2024 - BenoƮt Monin diff --git a/python-Markdown.spec b/python-Markdown.spec index 4879f17..e0f7b01 100644 --- a/python-Markdown.spec +++ b/python-Markdown.spec @@ -17,7 +17,16 @@ %{?sle15_python_module_pythons} -Name: python-Markdown +%global flavor @BUILD_FLAVOR@%{nil} +%if "%{flavor}" == "test" +%define psuffix -test +%bcond_without test +%endif +%if "%{flavor}" == "" +%define psuffix %{nil} +%bcond_with test +%endif +Name: python-Markdown%{psuffix} Version: 3.6 Release: 0 Summary: Python implementation of Markdown @@ -26,7 +35,6 @@ Group: Development/Languages/Python URL: https://python-markdown.github.io/ Source: https://files.pythonhosted.org/packages/source/M/Markdown/Markdown-%{version}.tar.gz Patch0: markdown-3.0-python37.patch -BuildRequires: %{python_module PyYAML} BuildRequires: %{python_module base >= 3.8} BuildRequires: %{python_module importlib-metadata >= 4.4 if %python-base < 3.10} BuildRequires: %{python_module pip} @@ -34,9 +42,11 @@ BuildRequires: %{python_module setuptools} BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros -%if 0%{?python_version_nodots} < 310 -Requires: python-importlib-metadata >= 4.4 +%if %{with test} +BuildRequires: %{python_module Markdown = %{version}} +BuildRequires: %{python_module PyYAML} %endif +Requires: (python-importlib-metadata >= 4.4 if python-base < 3.10) Requires(post): update-alternatives Requires(postun): update-alternatives BuildArch: noarch @@ -53,17 +63,24 @@ supported by the [Available Extensions][]. %autosetup -p1 -n Markdown-%{version} %build +%if %{without test} %pyproject_wheel +%endif %install +%if %{without test} %pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %python_clone -a %{buildroot}%{_bindir}/markdown_py +%endif %check +%if %{with test} %pyunittest discover -v +%endif +%if %{without test} %post %python_install_alternative markdown_py @@ -76,5 +93,6 @@ supported by the [Available Extensions][]. %python_alternative %{_bindir}/markdown_py %{python_sitelib}/Markdown-%{version}*-info %{python_sitelib}/markdown +%endif %changelog