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

s3_bucket - fix typing for Python <3.9 #2288

Merged

Conversation

tremble
Copy link
Contributor

@tremble tremble commented Sep 9, 2024

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

@tremble tremble added the backport-8 PR should be backported to the stable-8 branch label Sep 9, 2024
Copy link
Contributor

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/7e3de3b3139543918a881bd6e5c366d2

✔️ ansible-galaxy-importer SUCCESS in 4m 39s
✔️ build-ansible-collection SUCCESS in 10m 35s
✔️ ansible-test-splitter SUCCESS in 4m 21s
✔️ integration-amazon.aws-1 SUCCESS in 7m 49s
Skipped 43 jobs

@tremble tremble requested review from hakbailey, abikouo and alinabuzachis and removed request for hakbailey September 10, 2024 08:56
@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/1e53d55af22c431884f9a1fb99ce5de5

✔️ ansible-galaxy-importer SUCCESS in 4m 03s
✔️ build-ansible-collection SUCCESS in 10m 35s
✔️ ansible-test-splitter SUCCESS in 4m 18s
✔️ integration-amazon.aws-1 SUCCESS in 8m 21s
Skipped 43 jobs

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit 55460c9 into ansible-collections:main Sep 10, 2024
38 checks passed
Copy link

patchback bot commented Sep 10, 2024

Backport to stable-8: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-8/55460c9e415890b5900135016f45c62e7c69f039/pr-2288

Backported as #2290

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Sep 10, 2024
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)
softwarefactory-project-zuul bot pushed a commit that referenced this pull request 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

Reviewed-by: Mark Chappell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-8 PR should be backported to the stable-8 branch mergeit Merge the PR (SoftwareFactory)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

s3_bucket: typing requires Python>=3.9
2 participants