Add compatibility for Python 3.13#473
Conversation
a2d27aa to
bab892e
Compare
|
@rominf this needs rebasing |
bab892e to
2ca6161
Compare
|
@webknjaz I rebased the PR. Could you please re-review it? |
| @@ -4,6 +4,14 @@ | |||
|
|
|||
| .. towncrier release notes start | |||
There was a problem hiding this comment.
weird to see this and no towncrier config in the repo..
|
|
||
|
|
||
| def _server_resource(name: str, /) -> Generator[Path, None, None]: | ||
| ref = importlib_resources.files("aiosmtpd.tests.certs") / name |
There was a problem hiding this comment.
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.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
I created a PR with the changes proposed: #552. Please have a look! Thank you!
|
@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). |
2ca6161 to
bfd022a
Compare
This comment was marked as resolved.
This comment was marked as resolved.
a0dd42d to
83e2701
Compare
|
Hi aiosmtpd maintainers! It would be great if this issue can be fixed. Thanks for all the work :-) Cheers |
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.
83e2701 to
9005f4e
Compare
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)
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)
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)
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)
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)
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)
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)
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)
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)
|
Dear maintainers, could you please proceed with the merge? |
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)
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)
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)
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)
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)
What do these changes do?
pytest-profilingpytest-asynciotracesAre there changes in behavior for the user?
Related issue number
Closes #403.
Checklist
{py38,py39,py310,py311,py312,py313}-{cov}NEWS.rstfile