Accepting request 1037046 from devel:languages:python:mailman:backports

Fix the build and tests.

OBS-URL: https://build.opensuse.org/request/show/1037046
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:mailman/python-postorius?expand=0&rev=43
This commit is contained in:
2022-11-22 10:36:45 +00:00
committed by Git OBS Bridge
parent 5b19a9286c
commit 7e8868ca92
3 changed files with 9 additions and 90 deletions

View File

@@ -59,9 +59,6 @@ Source12: postorius.uwsgi
Source20: README.SUSE.md
#
Patch0: postorius-settings.patch
# Make compatible with django 4.0
# https://gitlab.com/mailman/postorius/-/commit/db2bd36a76f21d0637b5b7894f564918161c3185
Patch1: postorius-fix-django-4.0-compatibility.patch
#
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
@@ -81,7 +78,9 @@ BuildRequires: mailman3 >= 3.3.5
BuildRequires: %{python_module Django >= 2.2}
BuildRequires: %{python_module beautifulsoup4}
BuildRequires: %{python_module cmarkgfm}
BuildRequires: %{python_module django-debug-toolbar >= 2.2}
BuildRequires: %{python_module django-mailman3 >= 1.3.7}
BuildRequires: %{python_module django-requests-debug-toolbar >= 0.0.3}
BuildRequires: %{python_module isort}
BuildRequires: %{python_module mailmanclient >= 3.3.3}
BuildRequires: %{python_module pytest-django}
@@ -97,7 +96,9 @@ A web user interface for GNU Mailman
%package -n %{postorius_pkgname}
Summary: A web user interface for GNU Mailman
Requires: %{mypython}-Django >= 1.11
Requires: %{mypython}-django-debug-toolbar >= 2.2.0
Requires: %{mypython}-django-mailman3 >= 1.3.7
Requires: %{mypython}-django-requests-debug-toolbar >= 0.0.3
Requires: %{mypython}-mailmanclient >= 3.3.2
Requires: %{mypython}-readme_renderer
%if "%{expand:%%%{mypython}_provides}" == "python3"
@@ -199,14 +200,12 @@ install -d -m 0755 %{buildroot}%{_sysconfdir}/uwsgi/vassals
install -m 0644 %{SOURCE12} %{buildroot}%{_sysconfdir}/uwsgi/vassals/postorius.ini
%check
pushd example_project
export PYTHONPATH='../src'
export PYTHONPATH="$(pwd):$(pwd)/src"
export LANG=C.UTF-8
%pytest ..
%pytest
# clean flavored alternatives created by test setup, because we are going to install the example_project as docs
rm -rf build/flavorbin
rm -rf build/xdgflavorconfig
popd
%pre -n %{postorius_pkgname}-web
/usr/sbin/groupadd -r postorius &>/dev/null || :
@@ -246,6 +245,7 @@ fi
%{postorius_basedir}/static/admin
%{postorius_basedir}/static/django-mailman3
%{postorius_basedir}/static/postorius
%{postorius_basedir}/static/debug_toolbar
%attr(750,root,postorius) %dir %{postorius_etcdir}
%attr(640,root,postorius) %config(noreplace) %{postorius_etcdir}/settings_local.py