forked from pool/python-aiosmtpd
Compare commits
8 Commits
| Author | SHA256 | Date | |
|---|---|---|---|
| 8ccb852ca7 | |||
| 4361400d67 | |||
| 82ab17c59c | |||
| f15213952d | |||
| 7304d6e66a | |||
| e64059dac5 | |||
| 86d79a5488 | |||
| b29124603c |
47
aiosmtpd-pr557-pkg_resources.patch
Normal file
47
aiosmtpd-pr557-pkg_resources.patch
Normal file
@@ -0,0 +1,47 @@
|
||||
From 533ed1304c57bc7179bf88e5f5f81f4bb329b1dd Mon Sep 17 00:00:00 2001
|
||||
From: John Bucy <bucy@gloop.org>
|
||||
Date: Wed, 18 Jun 2025 11:05:23 -0700
|
||||
Subject: [PATCH 1/2] migrate config_test from pkg_resources to
|
||||
importlib_resources
|
||||
|
||||
pkg_resources is now throwing a deprecation warning
|
||||
this is only used to get the cert filenames
|
||||
|
||||
https://setuptools.pypa.io/en/latest/pkg_resources.html
|
||||
https://importlib-resources.readthedocs.io/en/latest/migration.html
|
||||
---
|
||||
aiosmtpd/tests/conftest.py | 13 ++++++++++---
|
||||
requirements-dev.txt | 1 +
|
||||
2 files changed, 11 insertions(+), 3 deletions(-)
|
||||
|
||||
Index: aiosmtpd-1.4.6/aiosmtpd/tests/conftest.py
|
||||
===================================================================
|
||||
--- aiosmtpd-1.4.6.orig/aiosmtpd/tests/conftest.py
|
||||
+++ aiosmtpd-1.4.6/aiosmtpd/tests/conftest.py
|
||||
@@ -12,7 +12,7 @@ from smtplib import SMTP as SMTPClient
|
||||
from typing import Any, Callable, Generator, NamedTuple, Optional, Type, TypeVar
|
||||
|
||||
import pytest
|
||||
-from pkg_resources import resource_filename
|
||||
+import importlib.resources
|
||||
from pytest_mock import MockFixture
|
||||
|
||||
from aiosmtpd.controller import Controller
|
||||
@@ -73,8 +73,15 @@ class Global:
|
||||
# If less than 1.0, might cause intermittent error if test system
|
||||
# is too busy/overloaded.
|
||||
AUTOSTOP_DELAY = 1.5
|
||||
-SERVER_CRT = resource_filename("aiosmtpd.tests.certs", "server.crt")
|
||||
-SERVER_KEY = resource_filename("aiosmtpd.tests.certs", "server.key")
|
||||
+# https://importlib-resources.readthedocs.io/en/latest/migration.html
|
||||
+# this assumes these files are already present in the filesystem so
|
||||
+# it doesn't need to extract a tempfile for the context manager to clean up
|
||||
+ref = importlib.resources.files("aiosmtpd.tests.certs") / "server.crt"
|
||||
+with importlib.resources.as_file(ref) as path:
|
||||
+ SERVER_CRT = str(path)
|
||||
+ref = importlib.resources.files("aiosmtpd.tests.certs") / "server.key"
|
||||
+with importlib.resources.as_file(ref) as path:
|
||||
+ SERVER_KEY = str(path)
|
||||
|
||||
# endregion
|
||||
|
||||
@@ -1,3 +1,28 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Jan 2 12:16:00 UTC 2026 - Ben Greiner <code@bnavigator.de>
|
||||
|
||||
- Add aiosmtpd-pr557-pkg_resources.patch gh#aio-libs/aiosmtpd#557
|
||||
for setuptools 80
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Nov 10 04:59:40 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
- Add patch support-python-314.patch:
|
||||
* Use inspect.iscoroutine, rather than asyncio.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Jun 16 12:16:45 UTC 2025 - Markéta Machová <mmachova@suse.com>
|
||||
|
||||
- Convert to libalternatives
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Nov 27 23:07:53 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
- 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 <daniel.garcia@suse.com>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package python-aiosmtpd
|
||||
#
|
||||
# Copyright (c) 2024 SUSE LLC
|
||||
# Copyright (c) 2026 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
|
||||
@@ -16,25 +16,32 @@
|
||||
#
|
||||
|
||||
|
||||
%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
|
||||
Group: Development/Languages/Python
|
||||
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
|
||||
# PATCH-FIX-UPSTREAM aiosmtpd-pr557-pkg_resources.patch gh#aio-libs/aiosmtpd#557
|
||||
Patch2: aiosmtpd-pr557-pkg_resources.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: (python-typing_extensions if python-base < 3.8)
|
||||
Requires: user(nobody)
|
||||
Requires(post): update-alternatives
|
||||
Requires(postun): update-alternatives
|
||||
BuildArch: noarch
|
||||
# SECTION test requirements
|
||||
BuildRequires: %{python_module atpublic}
|
||||
@@ -42,7 +49,6 @@ BuildRequires: %{python_module attrs}
|
||||
BuildRequires: %{python_module pytest-asyncio}
|
||||
BuildRequires: %{python_module pytest-mock}
|
||||
BuildRequires: %{python_module pytest}
|
||||
BuildRequires: %{python_module typing_extensions if %python-base < 3.8}
|
||||
BuildRequires: user(nobody)
|
||||
# /SECTION
|
||||
%python_subpackages
|
||||
@@ -68,10 +74,10 @@ This package provides such an implementation of both the SMTP and LMTP protocols
|
||||
sed -i '/--cov=/d' pytest.ini
|
||||
|
||||
%build
|
||||
%python_build
|
||||
%pyproject_wheel
|
||||
|
||||
%install
|
||||
%python_install
|
||||
%pyproject_install
|
||||
%python_clone -a %{buildroot}%{_bindir}/aiosmtpd
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||
|
||||
@@ -86,18 +92,15 @@ ignore="--ignore aiosmtpd/tests/test_server.py"
|
||||
|
||||
%pytest $ignore
|
||||
|
||||
%post
|
||||
%python_install_alternative aiosmtpd
|
||||
|
||||
%postun
|
||||
%python_uninstall_alternative aiosmtpd
|
||||
%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}*-info
|
||||
%{python_sitelib}/aiosmtpd-%{version}.dist-info
|
||||
%exclude %{python_sitelib}/aiosmtpd/docs
|
||||
|
||||
%changelog
|
||||
|
||||
26
support-python-313.patch
Normal file
26
support-python-313.patch
Normal file
@@ -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"
|
||||
13
support-python-314.patch
Normal file
13
support-python-314.patch
Normal file
@@ -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:
|
||||
Reference in New Issue
Block a user