From f15213952d682f59a30a07b9aadb1acadd2d20ebd09a4b25a40bb0e1c731102c Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Mon, 10 Nov 2025 05:00:49 +0000 Subject: [PATCH] - Add patch support-python-314.patch: * Use inspect.iscoroutine, rather than asyncio. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-aiosmtpd?expand=0&rev=36 --- .gitattributes | 23 ++++++++ .gitignore | 1 + aiosmtpd-1.4.6.tar.gz | 3 + python-aiosmtpd.changes | 118 +++++++++++++++++++++++++++++++++++++++ python-aiosmtpd.spec | 104 ++++++++++++++++++++++++++++++++++ support-python-313.patch | 26 +++++++++ support-python-314.patch | 13 +++++ 7 files changed, 288 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 aiosmtpd-1.4.6.tar.gz create mode 100644 python-aiosmtpd.changes create mode 100644 python-aiosmtpd.spec create mode 100644 support-python-313.patch create mode 100644 support-python-314.patch diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/aiosmtpd-1.4.6.tar.gz b/aiosmtpd-1.4.6.tar.gz new file mode 100644 index 0000000..bbf5fbc --- /dev/null +++ b/aiosmtpd-1.4.6.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7e045ee718790ece6880f1eae8a166859282ed7e1824bf9df5a4f631176c5723 +size 153632 diff --git a/python-aiosmtpd.changes b/python-aiosmtpd.changes new file mode 100644 index 0000000..b54b8f6 --- /dev/null +++ b/python-aiosmtpd.changes @@ -0,0 +1,118 @@ +------------------------------------------------------------------- +Mon Nov 10 04:59:40 UTC 2025 - Steve Kowalik + +- Add patch support-python-314.patch: + * Use inspect.iscoroutine, rather than asyncio. + +------------------------------------------------------------------- +Mon Jun 16 12:16:45 UTC 2025 - Markéta Machová + +- Convert to libalternatives + +------------------------------------------------------------------- +Wed Nov 27 23:07:53 UTC 2024 - Steve Kowalik + +- Switch to pyproject macros. +- Add patch support-python-313.patch: + * With Python 3.13, the listening asyncio Unix socket is removed + on close + +------------------------------------------------------------------- +Mon May 20 11:20:49 UTC 2024 - Daniel Garcia + +- Update to 1.4.6 (bsc#1224467, CVE-2024-34083): + * STARTTLS is now fully enforced if used. + +------------------------------------------------------------------- +Mon Apr 1 12:22:50 UTC 2024 - Daniel Garcia + +- Reenable tests for tumbleweed and Leap. Adds the + python-pytest-asyncio build requirements for tests and ignore some + tests that are failing for Leap but not for Factory. + +------------------------------------------------------------------- +Thu Mar 14 07:06:26 UTC 2024 - Matej Cepl + +- Clean up the SPEC file. +- Remove LICENSE-2.0.txt, it is now included in the tarball. + +------------------------------------------------------------------- +Wed Mar 13 16:32:38 UTC 2024 - Daniel Garcia + +- Update to 1.4.5 (bsc#1221328, CVE-2024-27305): + * Fixed incorrect handling of newlines. +- remove not needed python-aiosmtpd.rpmlintrc + +------------------------------------------------------------------- +Thu Jun 15 12:01:59 UTC 2023 - Andreas Schneider + +- Use sle15_python_module_pythons + +------------------------------------------------------------------- +Wed Feb 15 14:01:02 UTC 2023 - Dirk Müller + +- update to 1.4.4.post2: + * Prevent unclean repo from being built (Closes #365) + * Reduce chance of not-ready-for-release packages from being + uploaded + * No longer expect an implicit creation of the event loop + through ``get_event_loop()`` (Closes #353) + +------------------------------------------------------------------- +Wed Jan 4 16:48:10 UTC 2023 - Dirk Müller + +- update to 1.4.3: + * Is now compatible with uvloop + * Add compatibility for Python 3.10 and 3.11 (Closes #322) + * Test matrix update (Closes #306) + * Drop Python 3.6, PyPy 3.6 (some) and MacOS 10 + * Add Python 3.10 & 3.11, PyPy 3.7 & 3.8, Ubuntu 22.04, MacOS 11 & 12 + * Expanded tox environments + * Longer AUTOSTOP_DELAY especially for Windows (Closes #313) + * Update signing keys + * Some documentation fixes + +------------------------------------------------------------------- +Mon Nov 21 16:19:40 UTC 2022 - Daniel Garcia + +- Skip rpmlint error python-tests-in-package. +- Remove python_module macro definition. + +------------------------------------------------------------------- +Tue Jan 11 20:08:35 UTC 2022 - Ben Greiner + +- Remove hardcoded conditional on python36 flavor which got removed + in Tumbleweed + +------------------------------------------------------------------- +Fri Nov 19 08:35:23 UTC 2021 - Andreas Schneider + +- Disable pytest on Leap <= 15.3 + +------------------------------------------------------------------- +Tue May 4 10:15:40 UTC 2021 - Ben Greiner + +- Update runtime and build requirements +- Skip a failing test, which is marked xfail anyway but too late +- Exclude docs install into sitelib directory + +------------------------------------------------------------------- +Mon Mar 22 08:44:16 UTC 2021 - Michael Ströder + +- update to 1.4.2 +- dropped obsolete f414dcdc.patch + +------------------------------------------------------------------- +Wed May 27 09:36:02 UTC 2020 - Petr Gajdos + +- %python3_only -> %python_alternative + +------------------------------------------------------------------- +Thu Jan 2 07:32:50 UTC 2020 - Tomáš Chvátal + +- Do not install examples in generic examples folder in sitelib + +------------------------------------------------------------------- +Wed Sep 11 12:56:40 PM UTC 2019 - John Vandenberg + +- Initial spec for v1.2.1 diff --git a/python-aiosmtpd.spec b/python-aiosmtpd.spec new file mode 100644 index 0000000..9f78eb4 --- /dev/null +++ b/python-aiosmtpd.spec @@ -0,0 +1,104 @@ +# +# spec file for package python-aiosmtpd +# +# Copyright (c) 2025 SUSE LLC and contributors +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%bcond_without libalternatives +%{?sle15_python_module_pythons} +Name: python-aiosmtpd +Version: 1.4.6 +Release: 0 +Summary: SMTP server based on asyncio +License: Apache-2.0 +URL: https://aiosmtpd.readthedocs.io/ +Source: https://github.com/aio-libs/aiosmtpd/archive/v%{version}.tar.gz#/aiosmtpd-%{version}.tar.gz +# PATCH-FIX-UPSTREAM Based on gh#aio-libs/aiosmtpd#473 +Patch0: support-python-313.patch +# PATCH-FIX-OPENSUSE Use inspect.iscorountine +Patch1: support-python-314.patch +BuildRequires: %{python_module pip} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} +BuildRequires: alts +BuildRequires: fdupes +BuildRequires: git-core +BuildRequires: python-rpm-macros +Requires: alts +Requires: python-atpublic +Requires: python-attrs +Requires: user(nobody) +BuildArch: noarch +# SECTION test requirements +BuildRequires: %{python_module atpublic} +BuildRequires: %{python_module attrs} +BuildRequires: %{python_module pytest-asyncio} +BuildRequires: %{python_module pytest-mock} +BuildRequires: %{python_module pytest} +BuildRequires: user(nobody) +# /SECTION +%python_subpackages + +%description +The Python standard library includes a basic SMTP server in the smtpd module, +based on the old asynchronous libraries asyncore and asynchat. These modules +are quite old and are definitely showing their age; asyncore and asynchat are +difficult APIs to work with, understand, extend, and fix. + +With the introduction of the asyncio module in Python 3.4, a much better way of +doing asynchronous I/O is now available. It seems obvious that an asyncio-based +version of the SMTP and related protocols are needed for Python 3. This project +brings together several highly experienced Python developers collaborating on +this reimplementation. + +This package provides such an implementation of both the SMTP and LMTP protocols. + +%prep +%autosetup -p1 -n aiosmtpd-%{version} + +# Don't bother with the code coverage while packaging +sed -i '/--cov=/d' pytest.ini + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_clone -a %{buildroot}%{_bindir}/aiosmtpd +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +ignore="" + +%if 0%{?sle_version} +# One of the tests in this file breaks the tests client state for +# Leap, so it's ignored for now. +ignore="--ignore aiosmtpd/tests/test_server.py" +%endif + +%pytest $ignore + +%pre +%python_libalternatives_reset_alternative aiosmtpd + +%files %{python_files} +%doc README.rst +%license LICENSE +%python_alternative %{_bindir}/aiosmtpd +%{python_sitelib}/aiosmtpd +%{python_sitelib}/aiosmtpd-%{version}.dist-info +%exclude %{python_sitelib}/aiosmtpd/docs + +%changelog diff --git a/support-python-313.patch b/support-python-313.patch new file mode 100644 index 0000000..04b6ca2 --- /dev/null +++ b/support-python-313.patch @@ -0,0 +1,26 @@ +diff --git a/aiosmtpd/tests/test_server.py b/aiosmtpd/tests/test_server.py +index 443c0833..d2251d4a 100644 +--- a/aiosmtpd/tests/test_server.py ++++ b/aiosmtpd/tests/test_server.py +@@ -448,10 +448,17 @@ def test_unixsocket(self, safe_socket_dir, autostop_loop, runner): + # Stop the task + cont.end() + catchup_delay() +- # Now the listener has gone away +- # noinspection PyTypeChecker +- with pytest.raises((socket.timeout, ConnectionError)): +- assert_smtp_socket(cont) ++ if sys.version_info < (3, 13): ++ # Now the listener has gone away ++ # noinspection PyTypeChecker ++ with pytest.raises((socket.timeout, ConnectionError)): ++ assert_smtp_socket(cont) ++ else: ++ # Starting from Python 3.13, listening asyncio Unix socket is ++ # removed on close, see: ++ # https://github.com/python/cpython/issues/111246 ++ # https://github.com/python/cpython/pull/111483 ++ assert not Path(cont.unix_socket).exists() + + @pytest.mark.filterwarnings( + "ignore::pytest.PytestUnraisableExceptionWarning" diff --git a/support-python-314.patch b/support-python-314.patch new file mode 100644 index 0000000..7723c0b --- /dev/null +++ b/support-python-314.patch @@ -0,0 +1,13 @@ +Index: aiosmtpd-1.4.6/aiosmtpd/smtp.py +=================================================================== +--- aiosmtpd-1.4.6.orig/aiosmtpd/smtp.py ++++ aiosmtpd-1.4.6/aiosmtpd/smtp.py +@@ -1526,7 +1526,7 @@ class SMTP(asyncio.StreamReaderProtocol) + assert self.session is not None + args = (self.session.peer, self.envelope.mail_from, + self.envelope.rcpt_tos, self.envelope.content) +- if asyncio.iscoroutinefunction( ++ if inspect.iscoroutinefunction( + self.event_handler.process_message): + status = await self.event_handler.process_message(*args) + else: