Skip to content

Commit

Permalink
Add compatibility for Python 3.13
Browse files Browse the repository at this point in the history
Closes #403.
  • Loading branch information
rominf committed Aug 31, 2024
1 parent 57843a7 commit 2ca6161
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
name: Test
strategy:
matrix:
pyver: ['3.8', '3.9', '3.10', '3.11', '3.12']
pyver: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
os: [ubuntu, macos, windows]
include:
- pyver: pypy-3.8
Expand Down
8 changes: 8 additions & 0 deletions aiosmtpd/docs/NEWS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@

.. towncrier release notes start
1.4.7 (aiosmtpd-next)
=====================

Fixed/Improved
--------------

* Add compatibility for Python 3.13 (Closes #403)

1.4.6 (2024-05-18)
==================

Expand Down
15 changes: 11 additions & 4 deletions aiosmtpd/tests/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ classifiers =
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Python :: 3.13
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: Implementation :: PyPy
Topic :: Communications :: Email :: Mail Transport Agents
Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
minversion = 3.9.0
envlist = qa, static, docs, py{38,39,310,311,312,py3}-{nocov,cov,diffcov}
envlist = qa, static, docs, py{38,39,310,311,312,313,py3}-{nocov,cov,diffcov}
skip_missing_interpreters = True

[testenv]
Expand Down Expand Up @@ -41,6 +41,7 @@ setenv =
py310: INTERP=py310
py311: INTERP=py311
py312: INTERP=py312
py313: INTERP=py313
pypy3: INTERP=pypy3
pypy38: INTERP=pypy38
pypy39: INTERP=pypy39
Expand Down

0 comments on commit 2ca6161

Please sign in to comment.