Petr Gajdos 2019-10-01 08:05:42 +00:00 committed by Git OBS Bridge
parent cbfe4ad007
commit cca1de8490
3 changed files with 54 additions and 3 deletions

3
_multibuild Normal file
View File

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

View File

@ -0,0 +1,13 @@
Index: mailman-3.3.0/src/mailman/utilities/tests/test_interact.py
===================================================================
--- mailman-3.3.0.orig/src/mailman/utilities/tests/test_interact.py 2019-04-25 07:07:47.000000000 +0200
+++ mailman-3.3.0/src/mailman/utilities/tests/test_interact.py 2019-09-30 16:27:50.460382346 +0200
@@ -67,7 +67,7 @@ class TestInteract(unittest.TestCase):
self._enter(hackenv('PYTHONSTARTUP', None))
interact()
stderr = self._stderr.getvalue().splitlines()
- banner = 'Python {} on {} '.format(sys.version, sys.platform)
+ banner = 'Python {} on {}'.format(sys.version, sys.platform)
self.assertEqual(stderr[0], banner.splitlines()[0])
def test_interact_custom_banner(self):

View File

@ -14,6 +14,14 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
@ -25,10 +33,12 @@ Summary: Mailman -- the GNU mailing list manager
Url: https://www.list.org
Group: Development/Languages/Python
Source: https://files.pythonhosted.org/packages/source/m/mailman/mailman-%{version}.tar.gz
# whitespace fix
Patch0: python-mailman-test_interact_default_banner.patch
BuildRequires: python-rpm-macros
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
# SECTION test requirements
%if %{with test}
BuildRequires: %{python_module aiosmtpd >= 1.1}
BuildRequires: %{python_module alembic}
BuildRequires: %{python_module atpublic}
@ -46,6 +56,8 @@ BuildRequires: %{python_module lazr.config}
BuildRequires: %{python_module passlib}
BuildRequires: %{python_module python-dateutil >= 2.0}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module mailman >= %{version}}
BuildRequires: %{python_module nose}
BuildRequires: %{python_module nose2}
BuildRequires: %{python_module requests}
BuildRequires: %{python_module sqlalchemy >= 1.2.3}
@ -53,14 +65,14 @@ BuildRequires: %{python_module zope.component}
BuildRequires: %{python_module zope.configuration}
BuildRequires: %{python_module zope.event}
BuildRequires: %{python_module zope.interface}
# /SECTION
%endif
BuildRequires: fdupes
Requires: python-aiosmtpd >= 1.1
Requires: python-alembic
Requires: python-atpublic
Requires: python-authheaders >= 0.9.2
Requires: python-authres >= 1.0.1
Requires: python-click >= 7.0.0
Requires: python-click >= 7.0
Requires: python-dnspython >= 1.14.0
Requires: python-falcon > 1.0.0
Requires: python-flufl.bounce
@ -86,6 +98,7 @@ Mailman -- the GNU mailing list manager
%prep
%setup -q -n mailman-%{version}
%patch0 -p1
%build
pushd src/mailman
@ -95,15 +108,36 @@ for i in $(grep -r '^from importlib_resources' | sed 's/\(.*\.py\):.*/\1/'); do
sed -i "s@^\(from importlib_resources.*\)@try:\n from importlib.resources import $what_import\nexcept ImportError:\n \1\n@" $i;
done
popd
sed '/importlib_resources/d' -i src/mailman.egg-info/requires.txt setup.py
%python_build
%install
%if !%{with test}
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif
%check
%if %{with test}
# tests, that needs to be fixed (ERRORs)
# removing whole test files, I have not found a way to
# skip individual tests besides patching
#
# relies on /usr/bin/master to be available,
# however it needs root privileges
rm src/mailman/commands/tests/test_cli_control.py
# relies on /dev/stdout is not available
rm src/mailman/core/tests/test_logging.py
# 550 'Requested action not taken: mailbox unavailable'
rm src/mailman/runners/tests/test_lmtp.py
# 451 'Requested action aborted: error in processing'
rm src/mailman/rest/tests/test_membership.py
# 'error while attempting to bind on address ('127.0.0.1', 9025): address already in use'
#rm src/mailman/testing/layers.py
%python_exec -m nose2 -v
%endif
%if !%{with test}
%files %{python_files}
%doc README.rst
%license COPYING
@ -111,5 +145,6 @@ popd
%python3_only %{_bindir}/mailman
%python3_only %{_bindir}/master
%{python_sitelib}/*
%endif
%changelog