Skip to content

Commit a0dd42d

Browse files
committed
Add compatibility for Python 3.13
Closes #403.
1 parent 59c02f7 commit a0dd42d

File tree

5 files changed

+24
-6
lines changed

5 files changed

+24
-6
lines changed

.github/workflows/ci-cd.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
name: Test
6767
strategy:
6868
matrix:
69-
pyver: ['3.8', '3.9', '3.10', '3.11', '3.12']
69+
pyver: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
7070
os: [ubuntu, macos, windows]
7171
include:
7272
- pyver: pypy-3.8
@@ -82,6 +82,7 @@ jobs:
8282
python-version: ${{ matrix.pyver }}
8383
cache: 'pip'
8484
cache-dependency-path: '**/requirements*.txt'
85+
allow-prereleases: true
8586
- name: Install dependencies
8687
uses: py-actions/py-dependency-install@v4
8788
with:

aiosmtpd/docs/NEWS.rst

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44

55
.. towncrier release notes start
66
7+
1.4.7 (aiosmtpd-next)
8+
=====================
9+
10+
Fixed/Improved
11+
--------------
12+
13+
* Added compatibility for Python 3.13 (Closes #403)
14+
715
1.4.6 (2024-05-18)
816
==================
917

aiosmtpd/tests/test_server.py

+11-4
Original file line numberDiff line numberDiff line change
@@ -448,10 +448,17 @@ def test_unixsocket(self, safe_socket_dir, autostop_loop, runner):
448448
# Stop the task
449449
cont.end()
450450
catchup_delay()
451-
# Now the listener has gone away
452-
# noinspection PyTypeChecker
453-
with pytest.raises((socket.timeout, ConnectionError)):
454-
assert_smtp_socket(cont)
451+
if sys.version_info < (3, 13):
452+
# Now the listener has gone away
453+
# noinspection PyTypeChecker
454+
with pytest.raises((socket.timeout, ConnectionError)):
455+
assert_smtp_socket(cont)
456+
else:
457+
# Starting from Python 3.13, listening asyncio Unix socket is
458+
# removed on close, see:
459+
# https://github.com/python/cpython/issues/111246
460+
# https://github.com/python/cpython/pull/111483
461+
assert not Path(cont.unix_socket).exists()
455462

456463
@pytest.mark.filterwarnings(
457464
"ignore::pytest.PytestUnraisableExceptionWarning"

setup.cfg

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ classifiers =
2626
Programming Language :: Python :: 3.10
2727
Programming Language :: Python :: 3.11
2828
Programming Language :: Python :: 3.12
29+
Programming Language :: Python :: 3.13
2930
Programming Language :: Python :: Implementation :: CPython
3031
Programming Language :: Python :: Implementation :: PyPy
3132
Topic :: Communications :: Email :: Mail Transport Agents

tox.ini

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tox]
22
minversion = 3.9.0
3-
envlist = qa, static, docs, py{38,39,310,311,312,py3}-{nocov,cov,diffcov}
3+
envlist = qa, static, docs, py{38,39,310,311,312,313,py3}-{nocov,cov,diffcov}
44
skip_missing_interpreters = True
55

66
[testenv]
@@ -41,6 +41,7 @@ setenv =
4141
py310: INTERP=py310
4242
py311: INTERP=py311
4343
py312: INTERP=py312
44+
py313: INTERP=py313
4445
pypy3: INTERP=pypy3
4546
pypy38: INTERP=pypy38
4647
pypy39: INTERP=pypy39

0 commit comments

Comments
 (0)