Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ansible: mail integration tests uses the asyncore module which has been removed in Python 3.11 #4656

Open
1 task done
vstinner opened this issue May 9, 2022 · 8 comments
Labels
bug This issue/PR relates to a bug has_pr tests tests

Comments

@vstinner
Copy link

vstinner commented May 9, 2022

Summary

The ansible_collections/community/general/tests/integration/targets/mail/files/smtpserver.py uses import asyncore whereas this module has been removed in Python 3.11, after being deprecated since Python 3.6.

One option is to copy Python 3.10 asyncore.py file in ansible test suite. Another is that someone should maintain an asyncore module on PyPI.

First, I reported the issue at ansible/ansible#76452 but I got rejected there.

Issue Type

Bug Report

Component Name

tests

Ansible Version

ansible-5.0.0 source code from PyPI.

Community.general Version

$ ansible-galaxy collection list community.general

Configuration

$ ansible-config dump --only-changed

OS / Environment

Any operating system.

Steps to Reproduce

Run the ansible integration test suite on Python 3.11: it emits a deprecation warning. The module will be removed from Python 3.12: see python/cpython#72719

Expected Results

ansible-5.0.0/ansible_collections/community/general/tests/integration/targets/mail/files/smtpserver.py must not fail.

Actual Results

I didn't try to run the Ansible test suite. I only noticed that "import asyncore" is used.

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibullbot
Copy link
Collaborator

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot ansibullbot added bug This issue/PR relates to a bug tests tests labels May 9, 2022
@vstinner
Copy link
Author

vstinner commented May 9, 2022

!component =tests/integration/targets/mail/files/smtpserver.py

@vstinner
Copy link
Author

vstinner commented May 9, 2022

Link to the line importing asyncore:

@ansibullbot
Copy link
Collaborator

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@felixfontein
Copy link
Collaborator

Thanks for this report! Instead of vendoring that module, I think we should better adjust the test.

@felixfontein
Copy link
Collaborator

The same test also depends on the smtpd module, which will be removed from Python 3.12.

I was about to suggest the following route:

  1. Continue to use the current solution for Python 2 and Python 3.5.
  2. Use another solution for Python 3.6+. aiosmtpd looks promising on the first glance, but it doesn't even support Python 3.10, and there have been no commits for over a year.

Right now I'm more thinking of installing and configuring something like postfix instead? That's probably more work, but seems less painful to maintain.

felixfontein added a commit to felixfontein/community.general that referenced this issue Nov 18, 2023
felixfontein added a commit that referenced this issue Nov 18, 2023
* devel supports Fedora 39, and no longer Fedora 38.

* Disable 'mail' tests for Python 3.12+.

Ref: #4656

* Fix setupSSLServer to work with Python 3.12.
patchback bot pushed a commit that referenced this issue Nov 18, 2023
* devel supports Fedora 39, and no longer Fedora 38.

* Disable 'mail' tests for Python 3.12+.

Ref: #4656

* Fix setupSSLServer to work with Python 3.12.

(cherry picked from commit b8ecb16)
patchback bot pushed a commit that referenced this issue Nov 18, 2023
* devel supports Fedora 39, and no longer Fedora 38.

* Disable 'mail' tests for Python 3.12+.

Ref: #4656

* Fix setupSSLServer to work with Python 3.12.

(cherry picked from commit b8ecb16)
felixfontein added a commit that referenced this issue Nov 18, 2023
…and no longer Fedora 38 (#7547)

CI: devel supports Fedora 39, and no longer Fedora 38 (#7541)

* devel supports Fedora 39, and no longer Fedora 38.

* Disable 'mail' tests for Python 3.12+.

Ref: #4656

* Fix setupSSLServer to work with Python 3.12.

(cherry picked from commit b8ecb16)

Co-authored-by: Felix Fontein <[email protected]>
felixfontein added a commit that referenced this issue Nov 18, 2023
…and no longer Fedora 38 (#7548)

CI: devel supports Fedora 39, and no longer Fedora 38 (#7541)

* devel supports Fedora 39, and no longer Fedora 38.

* Disable 'mail' tests for Python 3.12+.

Ref: #4656

* Fix setupSSLServer to work with Python 3.12.

(cherry picked from commit b8ecb16)

Co-authored-by: Felix Fontein <[email protected]>
samdoran pushed a commit to samdoran/community.general that referenced this issue Nov 21, 2023
…tions#7541)

* devel supports Fedora 39, and no longer Fedora 38.

* Disable 'mail' tests for Python 3.12+.

Ref: ansible-collections#4656

* Fix setupSSLServer to work with Python 3.12.
felixfontein pushed a commit that referenced this issue Apr 28, 2024
…and no longer Fedora 38 (#7547)

CI: devel supports Fedora 39, and no longer Fedora 38 (#7541)

* devel supports Fedora 39, and no longer Fedora 38.

* Disable 'mail' tests for Python 3.12+.

Ref: #4656

* Fix setupSSLServer to work with Python 3.12.

(cherry picked from commit b8ecb16)

Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit 3ce83dc)
@vstinner
Copy link
Author

vstinner commented Sep 6, 2024

No activity for 2 years, I close the issue.

@vstinner vstinner closed this as completed Sep 6, 2024
@felixfontein
Copy link
Collaborator

It's not resolved, so it should be kept open until someone wants to work on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug has_pr tests tests
Projects
None yet
Development

No branches or pull requests

3 participants