Accepting request 1193472 from devel:languages:python

- Split the package into multibuild with tests separate (to
  separate PyYAML dependency).

OBS-URL: https://build.opensuse.org/request/show/1193472
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-Markdown?expand=0&rev=47
This commit is contained in:
2024-08-17 10:40:57 +00:00
committed by Git OBS Bridge
4 changed files with 38 additions and 7 deletions

3
_multibuild Normal file
View File

@@ -0,0 +1,3 @@
<multibuild>
<package>test</package>
</multibuild>

View File

@@ -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')

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Aug 12 14:47:54 UTC 2024 - Matej Cepl <mcepl@cepl.eu>
- Split the package into multibuild with tests separate (to
separate PyYAML dependency).
-------------------------------------------------------------------
Fri Mar 15 19:46:03 UTC 2024 - Benoît Monin <benoit.monin@gmx.fr>

View File

@@ -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