Commit Graph

12 Commits (5ad3d14ceb758de7928897a66b235247aee6e1ff)

Author SHA1 Message Date
Alex Willmer 5ad3d14ceb mitogen: Support PEP 451 ModuleSpec API, required for Python 3.12
importlib.machinery.ModuleSpec and find_spec() were introduced in Python 3.4
under PEP 451. They replace the find_module() API of PEP 302, which was
deprecated from Python 3.4. They were removed in Python 3.12 along with the
imp module.

This change adds support for the PEP 451 APIs. Mitogen should no longer import
imp on Python versions that support ModuleSpec. Tests have been added to cover
the new APIs.

CI jobs have been added to cover Python 3.x on macOS.

Refs #1033
Co-authored-by: Witold Baryluk <witold.baryluk@gmail.com>
3 months ago
Alex Willmer e2f4d9275c tests: Fix ansible_python_interpreter & discovered_interpreter_python tests on macOS
Should account for fiddling in mitogen.parent.Connection._first_stage() and
symlinks. I won't be surprised if it breaks again soon and often.
3 months ago
Alex Willmer db0ffae352 tests: Enable stricter error handling, fix resulting failures 2 years ago
Klaus Zerwes 81f075340b use conditionals in list form 3 years ago
Klaus Zerwes e509c1fb77
Update tests/ansible/integration/interpreter_discovery/ansible_2_8_tests.yml
Co-authored-by: Alex Willmer <alex@moreati.org.uk>
3 years ago
Klaus Zerwes 3d450f0f22 fix interpreter discovery tests for changed python interpreter behaviour from ansible 2.12 on 3 years ago
Alex Willmer e194a6367f ci: Fix version comparisons involving double digits
See https://gist.github.com/moreati/e7507c5b606b12ec0ddafcb7c8debbf1
3 years ago
Alex Willmer 3c58215a91 tests: Tag Ansible tests
This makes it easier to run subsets using ANSIBLE_RUN_TAGS=...
3 years ago
Alex Willmer cfa5888547 tests: Print variables on failure of assert tasks
Fixes #852
3 years ago
Steven Robertson cfb5ebbdd3 ansible < 2.5 didn't have version, but had version_compare 4 years ago
Steven Robertson 38939b2c1b can't run ansible 2.8.0+ tests on ansible < 2.8.0 4 years ago
Steven Robertson 6d179da480 ported over tests from ansible validating python interpreter discovery 4 years ago