From cbfe4ad007b190b82b11b46a42093b025c515b8f9a4e0fcda8920047c1ab35d5 Mon Sep 17 00:00:00 2001 From: Petr Gajdos Date: Thu, 26 Sep 2019 14:09:00 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:mailman/python-mailman?expand=0&rev=6 --- python-mailman.spec | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/python-mailman.spec b/python-mailman.spec index f427497..ef12b4d 100644 --- a/python-mailman.spec +++ b/python-mailman.spec @@ -40,10 +40,13 @@ BuildRequires: %{python_module falcon > 1.0.0} BuildRequires: %{python_module flufl.bounce} BuildRequires: %{python_module flufl.i18n >= 2.0} BuildRequires: %{python_module flufl.lock >= 3.1} +BuildRequires: %{python_module flufl.testing} BuildRequires: %{python_module gunicorn} BuildRequires: %{python_module lazr.config} BuildRequires: %{python_module passlib} BuildRequires: %{python_module python-dateutil >= 2.0} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module nose2} BuildRequires: %{python_module requests} BuildRequires: %{python_module sqlalchemy >= 1.2.3} BuildRequires: %{python_module zope.component} @@ -85,6 +88,13 @@ Mailman -- the GNU mailing list manager %setup -q -n mailman-%{version} %build +pushd src/mailman +for i in $(grep -r '^from importlib_resources' | sed 's/\(.*\.py\):.*/\1/'); do + line=$(grep '^from importlib_resources' $i) + what_import=$(echo $line | sed 's:.* import ::') + sed -i "s@^\(from importlib_resources.*\)@try:\n from importlib.resources import $what_import\nexcept ImportError:\n \1\n@" $i; +done +popd %python_build %install @@ -92,7 +102,7 @@ Mailman -- the GNU mailing list manager %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -%python_exec setup.py test +%python_exec -m nose2 -v %files %{python_files} %doc README.rst