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

[PR #2288/55460c9e backport][stable-8] s3_bucket - fix typing for Python <3.9 #2290

Conversation

patchback[bot]
Copy link

@patchback patchback bot commented Sep 10, 2024

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

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)
@tremble tremble added the mergeit Merge the PR (SoftwareFactory) label Sep 10, 2024
Copy link
Contributor

Build succeeded (gate pipeline).
https://ansible.softwarefactory-project.io/zuul/buildset/510de824718848b2b1d9ebd86f737e1f

✔️ ansible-galaxy-importer SUCCESS in 4m 43s
✔️ build-ansible-collection SUCCESS in 10m 36s
✔️ ansible-test-splitter SUCCESS in 4m 19s
✔️ integration-amazon.aws-1 SUCCESS in 6m 53s
Skipped 43 jobs

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit b7770a5 into stable-8 Sep 10, 2024
34 of 37 checks passed
@softwarefactory-project-zuul softwarefactory-project-zuul bot deleted the patchback/backports/stable-8/55460c9e415890b5900135016f45c62e7c69f039/pr-2288 branch September 10, 2024 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mergeit Merge the PR (SoftwareFactory)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant