Skip to content

Add compatibility for Python 3.13 - #473

Draft
rominf wants to merge 4 commits into
aio-libs:masterfrom
rominf:rominf-python3.13
Draft

rominf wants to merge 4 commits into
aio-libs:masterfrom
rominf:rominf-python3.13

Conversation

@rominf

@rominf rominf commented Jun 28, 2024 •

Copy link
Copy Markdown
Contributor

What do these changes do?

  • Fix tox for Python >= 3.12
  • Remove pytest-profiling
  • Remove pytest-asyncio traces
  • Add compatibility for Python 3.13

Are there changes in behavior for the user?

  • Add compatibility for Python 3.13

Related issue number

Closes #403.

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • tox testenvs have been executed in the following environments:
    • Linux (Fedora 40): {py38,py39,py310,py311,py312,py313}-{cov}
  • Documentation reflects the changes
  • Add a news fragment into the NEWS.rst file
    • Add under the "aiosmtpd-next" section, creating one if necessary
      • You may create subsections to group the changes, if you like
    • Use full sentences with correct case and punctuation
    • Refer to relevant Issue if applicable

@rominf
rominf marked this pull request as ready for review June 28, 2024 05:48
@rominf
rominf force-pushed the rominf-python3.13 branch from a2d27aa to bab892e Compare June 28, 2024 05:50
Comment thread tox.ini Outdated
@webknjaz

Copy link
Copy Markdown
Member

@rominf this needs rebasing

@rominf
rominf force-pushed the rominf-python3.13 branch from bab892e to 2ca6161 Compare August 31, 2024 12:35
@rominf
rominf requested a review from webknjaz August 31, 2024 12:39
@rominf

rominf commented Sep 4, 2024

Copy link
Copy Markdown
Contributor Author

@webknjaz I rebased the PR. Could you please re-review it?

Comment thread aiosmtpd/docs/NEWS.rst Outdated
Comment thread aiosmtpd/docs/NEWS.rst
@@ -4,6 +4,14 @@

.. towncrier release notes start

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weird to see this and no towncrier config in the repo..

Comment thread aiosmtpd/tests/conftest.py Outdated


def _server_resource(name: str, /) -> Generator[Path, None, None]:
ref = importlib_resources.files("aiosmtpd.tests.certs") / name

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird this is shipped in wheels.. I'd go for a relative path myself.

OTOH, I recommend integrating https://trustme.rtfd.io like I did in aiohttp and many other places so that the TLS certificates are ephemeral and don't even exist in the repo.

This comment was marked as resolved.

@rominf rominf Apr 6, 2025 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created a PR with the changes proposed: #552. Please have a look! Thank you!

Comment thread tox.ini
@webknjaz

webknjaz commented Sep 5, 2024

Copy link
Copy Markdown
Member

@rominf I've triggered the CI for you but I'll leave it to the maintainers to merge. It looks like you missed a dependency file update somewhere (the CI doesn't call tox it seems).

@webknjaz
webknjaz requested review from pepoluan and waynew September 5, 2024 14:38
Comment thread aiosmtpd/tests/conftest.py
@rominf

This comment was marked as resolved.

@rominf
rominf force-pushed the rominf-python3.13 branch 2 times, most recently from a0dd42d to 83e2701 Compare September 6, 2024 06:10
@rominf
rominf requested a review from webknjaz September 6, 2024 06:18
@eamanu

This comment was marked as off-topic.

rominf added 4 commits April 5, 2025 17:33
Fix import error:
```
py312-cov: commands[2]> pytest --cov --cov-report=xml --cov-report=html --cov-report=term --tb=short
ImportError while loading conftest '/home/rominf/dev/aiosmtpd/aiosmtpd/tests/conftest.py'.
aiosmtpd/tests/conftest.py:15: in <module>
    from pkg_resources import resource_filename
E   ModuleNotFoundError: No module named 'pkg_resources'
```
by migrating to `importlib.resources`.
Remove [pytest-profiling](https://pypi.org/project/pytest-profiling/),
as it does not support latest Python versions, was not updated for 5
years, and according to the comment in `aiosmtpd/docs/testing.rst` was
not very useful anyway.
`pytest-asyncio` is unnecessary, it was missing in `tox.ini`, and tests
pass.
@rominf
rominf force-pushed the rominf-python3.13 branch from 83e2701 to 9005f4e Compare April 5, 2025 14:33
rominf added a commit to rominf/aiosmtpd that referenced this pull request Apr 6, 2025
With the current approach TLS certificate and key are hardcoded in
separate files and distributed as part of wheels.
This is unnecessary for end users of the package, also this brings
difficulties while supporting Python 3.13, see:
aio-libs#473

Use trustme for generating TLS certificate and key on the fly, as it is
done in other aio-libs packages.

Initially proposed in:
aio-libs#473 (comment)
rominf added a commit to rominf/aiosmtpd that referenced this pull request Apr 6, 2025
With the current approach TLS certificate and key are hardcoded in
separate files and distributed as part of wheels.
This is unnecessary for end users of the package, also this brings
difficulties while supporting Python 3.13, see:
aio-libs#473

Use trustme for generating TLS certificate and key on the fly, as it is
done in other aio-libs packages.

Initially proposed in:
aio-libs#473 (comment)
rominf added a commit to rominf/aiosmtpd that referenced this pull request Apr 8, 2025
With the current approach TLS certificate and key are hardcoded in
separate files and distributed as part of wheels.
This is unnecessary for end users of the package, also this brings
difficulties while supporting Python 3.13, see:
aio-libs#473

Use trustme for generating TLS certificate and key on the fly, as it is
done in other aio-libs packages.

Initially proposed in:
aio-libs#473 (comment)
@rominf rominf mentioned this pull request Apr 8, 2025
4 of 6 tasks
rominf added a commit to rominf/aiosmtpd that referenced this pull request Apr 13, 2025
With the current approach TLS certificate and key are hardcoded in
separate files and distributed as part of wheels.
This is unnecessary for end users of the package, also this brings
difficulties while supporting Python 3.13, see:
aio-libs#473

Use trustme for generating TLS certificate and key on the fly, as it is
done in other aio-libs packages.

Initially proposed in:
aio-libs#473 (comment)
rominf added a commit to rominf/aiosmtpd that referenced this pull request Apr 13, 2025
With the current approach TLS certificate and key are hardcoded in
separate files and distributed as part of wheels.
This is unnecessary for end users of the package, also this brings
difficulties while supporting Python 3.13, see:
aio-libs#473

Use trustme for generating TLS certificate and key on the fly, as it is
done in other aio-libs packages.

Initially proposed in:
aio-libs#473 (comment)
@rominf
rominf marked this pull request as draft April 13, 2025 06:51
rominf added a commit to rominf/aiosmtpd that referenced this pull request Apr 14, 2025
With the current approach TLS certificate and key are hardcoded in
separate files and distributed as part of wheels.
This is unnecessary for end users of the package, also this brings
difficulties while supporting Python 3.13, see:
aio-libs#473

Use trustme for generating TLS certificate and key on the fly, as it is
done in other aio-libs packages.

Initially proposed in:
aio-libs#473 (comment)
rominf added a commit to rominf/aiosmtpd that referenced this pull request Apr 14, 2025
With the current approach TLS certificate and key are hardcoded in
separate files and distributed as part of wheels.
This is unnecessary for end users of the package, also this brings
difficulties while supporting Python 3.13, see:
aio-libs#473

Use trustme for generating TLS certificate and key on the fly, as it is
done in other aio-libs packages.

Initially proposed in:
aio-libs#473 (comment)
rominf added a commit to rominf/aiosmtpd that referenced this pull request Apr 14, 2025
With the current approach TLS certificate and key are hardcoded in
separate files and distributed as part of wheels.
This is unnecessary for end users of the package, also this brings
difficulties while supporting Python 3.13, see:
aio-libs#473

Use trustme for generating TLS certificate and key on the fly, as it is
done in other aio-libs packages.

Initially proposed in:
aio-libs#473 (comment)
rominf added a commit to rominf/aiosmtpd that referenced this pull request Apr 14, 2025
With the current approach TLS certificate and key are hardcoded in
separate files and distributed as part of wheels.
This is unnecessary for end users of the package, also this brings
difficulties while supporting Python 3.13, see:
aio-libs#473

Use trustme for generating TLS certificate and key on the fly, as it is
done in other aio-libs packages.

Initially proposed in:
aio-libs#473 (comment)
@fumiyas

This comment was marked as off-topic.

rominf added a commit to rominf/aiosmtpd that referenced this pull request May 8, 2026
With the current approach TLS certificate and key are hardcoded in
separate files and distributed as part of wheels.
This is unnecessary for end users of the package, also this brings
difficulties while supporting Python 3.13, see:
aio-libs#473

Use trustme for generating TLS certificate and key on the fly, as it is
done in other aio-libs packages.

Initially proposed in:
aio-libs#473 (comment)
rominf added a commit to rominf/aiosmtpd that referenced this pull request May 9, 2026
With the current approach TLS certificate and key are hardcoded in
separate files and distributed as part of wheels.
This is unnecessary for end users of the package, also this brings
difficulties while supporting Python 3.13, see:
aio-libs#473

Use trustme for generating TLS certificate and key on the fly, as it is
done in other aio-libs packages.

Initially proposed in:
aio-libs#473 (comment)
rominf added a commit to rominf/aiosmtpd that referenced this pull request May 9, 2026
With the current approach TLS certificate and key are hardcoded in
separate files and distributed as part of wheels.
This is unnecessary for end users of the package, also this brings
difficulties while supporting Python 3.13, see:
aio-libs#473

Use trustme for generating TLS certificate and key on the fly, as it is
done in other aio-libs packages.

Initially proposed in:
aio-libs#473 (comment)
rominf added a commit to rominf/aiosmtpd that referenced this pull request May 9, 2026
With the current approach TLS certificate and key are hardcoded in
separate files and distributed as part of wheels.
This is unnecessary for end users of the package, also this brings
difficulties while supporting Python 3.13, see:
aio-libs#473

Use trustme for generating TLS certificate and key on the fly, as it is
done in other aio-libs packages.

Initially proposed in:
aio-libs#473 (comment)
rominf added a commit to rominf/aiosmtpd that referenced this pull request May 9, 2026
With the current approach TLS certificate and key are hardcoded in
separate files and distributed as part of wheels.
This is unnecessary for end users of the package, also this brings
difficulties while supporting Python 3.13, see:
aio-libs#473

Use trustme for generating TLS certificate and key on the fly, as it is
done in other aio-libs packages.

Initially proposed in:
aio-libs#473 (comment)
@webknjaz

webknjaz commented Jul 1, 2026

Copy link
Copy Markdown
Member

@rominf time to rebase?

@rominf

rominf commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

@webknjaz Hi, sorry, but I don't have a bandwidth for that in ~half a month. You can adopt the PR if you want, of course.

@webknjaz

webknjaz commented Sep 9, 2026

Copy link
Copy Markdown
Member

I won't have time to look into it but maybe @loqs and @cuu508 could

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

assert_smtp_socket fails with Python 3.13.0a3

6 participants