forked from pool/python-aiosmtpd
Accepting request 1226979 from devel:languages:python
- Switch to pyproject macros.
- Add patch support-python-313.patch:
* With Python 3.13, the listening asyncio Unix socket is removed
on close
OBS-URL: https://build.opensuse.org/request/show/1226979
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-aiosmtpd?expand=0&rev=16
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
-------------------------------------------------------------------
|
||||
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>
|
||||
|
||||
|
||||
@@ -22,16 +22,18 @@ 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
|
||||
BuildRequires: %{python_module pip}
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: %{python_module wheel}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: git-core
|
||||
BuildRequires: python-rpm-macros
|
||||
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
|
||||
@@ -42,7 +44,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 +69,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}
|
||||
|
||||
@@ -97,7 +98,7 @@ ignore="--ignore aiosmtpd/tests/test_server.py"
|
||||
%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"
|
||||
Reference in New Issue
Block a user