-
Notifications
You must be signed in to change notification settings - Fork 342
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
s3_bucket: typing requires Python>=3.9 #2287
Comments
Thanks for taking the time to report this issue. Unfortunately we stopped running some of our tests against Python < 3.9 to try and bring the test matrix down to something sensible, so this slipped through. FYI this collection dropped support for Python < 3.7 with release 7.0.0. While this isn't in line with the core Ansible requirements, the AWS SDK we use (botocore) has dropped support for older versions of Python, forcing our hand. |
Fixes: #2287 SUMMARY Support for type hinting generics in standard collections was first added in Python 3.9. We're currently not running the sanity tests against Python 3.7 (including the compilation/import tests), so we missed this. (We currently test 3.9-3.12) Using quay.io/ansible/default-test-container:8.12.0 locally to run the tests against 3.7 I see: (2.7 and 3.6 are skipped because this collection doesn't support them) Running sanity test "import" on Python 2.7 Running sanity test "import" on Python 3.6 Running sanity test "import" on Python 3.7 ERROR: Found 1 import issue(s) on python 3.7 which need to be resolved: ERROR: plugins/modules/s3_bucket.py:571:0: traceback: TypeError: 'type' object is not subscriptable See documentation for help: https://docs.ansible.com/ansible-core/2.16/dev_guide/testing/sanity/import.html Running sanity test "import" on Python 3.8 ERROR: Found 1 import issue(s) on python 3.8 which need to be resolved: ERROR: plugins/modules/s3_bucket.py:571:0: traceback: TypeError: 'type' object is not subscriptable See documentation for help: https://docs.ansible.com/ansible-core/2.16/dev_guide/testing/sanity/import.html Running sanity test "import" on Python 3.9 Running sanity test "import" on Python 3.10 Running sanity test "import" on Python 3.11 Running sanity test "import" on Python 3.12 ISSUE TYPE Bugfix Pull Request COMPONENT NAME s3_bucket ADDITIONAL INFORMATION Reviewed-by: Alina Buzachis (cherry picked from commit 55460c9)
This is a backport of PR #2288 as merged into main (55460c9). Fixes: #2287 SUMMARY Support for type hinting generics in standard collections was first added in Python 3.9. We're currently not running the sanity tests against Python 3.7 (including the compilation/import tests), so we missed this. (We currently test 3.9-3.12) Using quay.io/ansible/default-test-container:8.12.0 locally to run the tests against 3.7 I see: (2.7 and 3.6 are skipped because this collection doesn't support them) Running sanity test "import" on Python 2.7 Running sanity test "import" on Python 3.6 Running sanity test "import" on Python 3.7 ERROR: Found 1 import issue(s) on python 3.7 which need to be resolved: ERROR: plugins/modules/s3_bucket.py:571:0: traceback: TypeError: 'type' object is not subscriptable See documentation for help: https://docs.ansible.com/ansible-core/2.16/dev_guide/testing/sanity/import.html Running sanity test "import" on Python 3.8 ERROR: Found 1 import issue(s) on python 3.8 which need to be resolved: ERROR: plugins/modules/s3_bucket.py:571:0: traceback: TypeError: 'type' object is not subscriptable See documentation for help: https://docs.ansible.com/ansible-core/2.16/dev_guide/testing/sanity/import.html Running sanity test "import" on Python 3.9 Running sanity test "import" on Python 3.10 Running sanity test "import" on Python 3.11 Running sanity test "import" on Python 3.12 ISSUE TYPE Bugfix Pull Request COMPONENT NAME s3_bucket ADDITIONAL INFORMATION Reviewed-by: Mark Chappell
Summary
Changes introduced in #2057 use indices and "base types" for typing, e.g.
-> tuple[dict,dict]
that was introduced in Python3.9, while docs still specify Python3.6 as the minimum supported version.Switching to
typing...
types or bumping minimal Python version is probably the way to go with this issue.Issue Type
Bug Report
Component Name
s3_bucket
Ansible Version
Collection Versions
AWS SDK versions
Configuration
$ ansible-config dump --only-changed
OS / Environment
Target OS:
Steps to Reproduce
I am working with Ceph backend locally, but this issue should be reproducible with any configuration. The failure seems to happen at the Python parsing stage
Expected Results
Expected:
Actual Results
The "important" part:
Manually removing all
tuple[...,...]
typing from the collection and installing it locally allows Ansible to proceedCode of Conduct
The text was updated successfully, but these errors were encountered: