Skip to content

feat(general): add support for Python 3.11 #2820

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

Merged
merged 10 commits into from
Jul 24, 2023
Merged

Conversation

rubenfonseca
Copy link
Contributor

@rubenfonseca rubenfonseca commented Jul 21, 2023

Issue number: #2732

Summary

This PR adds support for Python 3.11.

Tasks to complete before merging this PR

  • Fix problems with snappy dev dependency
  • Fix problems with fastjsonschema v2.18.0
  • Fix problems with LRU tests
  • Validate all features supported by Powertools using AWS Lambda Python3.11 image
  • Validate Pydanticv2 using AWS Lambda Python3.11 image
  • Update all docs examples to use python3.11 instead of python3.10
  • Run e2e test

Checklist

If your change doesn't seem to apply, please leave them unchecked.

Is this a breaking change?

RFC issue number:

Checklist:

  • Migration process documented
  • Implement warnings (if it can live side by side)

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@rubenfonseca rubenfonseca requested a review from a team July 21, 2023 16:17
@boring-cyborg boring-cyborg bot added dependencies Pull requests that update a dependency file github-actions Pull requests that update Github_actions code github-templates tests labels Jul 21, 2023
@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 21, 2023
@rubenfonseca rubenfonseca linked an issue Jul 21, 2023 that may be closed by this pull request
2 tasks
@github-actions github-actions bot added the feature New feature or functionality label Jul 21, 2023
@heitorlessa heitorlessa changed the title feat: add support for Python 3.11 feat(general): add support for Python 3.11 Jul 21, 2023
@codecov-commenter
Copy link

codecov-commenter commented Jul 21, 2023

Codecov Report

Patch coverage has no change and project coverage change: +0.02 🎉

Comparison is base (ec62084) 97.54% compared to head (cc454ee) 97.57%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2820      +/-   ##
===========================================
+ Coverage    97.54%   97.57%   +0.02%     
===========================================
  Files          162      162              
  Lines         7469     7469              
  Branches       540     1416     +876     
===========================================
+ Hits          7286     7288       +2     
+ Misses         134      133       -1     
+ Partials        49       48       -1     

see 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@rubenfonseca
Copy link
Contributor Author

TODO: remove snappy dependency and all references in examples and documentation /cc @leandrodamascena

@pull-request-size pull-request-size bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 23, 2023
Copy link
Contributor

@leandrodamascena leandrodamascena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added some important information I found on this PR before we merged.

@@ -64,7 +64,7 @@ def test_lru_pop_failing():
cache[key] = "value"
try:
cache.pop(key, None)
pytest.fail("GitHub #300: LRUDict pop bug has been fixed :)")
pytest.fail("GitHub #300: LRUDict pop bug has been fixed.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE: I removed some characters to allow for adding a comment.

First time I had contact with this and the test is falling. I understand why it's failing in Python 3.11, but I have no idea why we need it here. Do you have any information about this worth sharing @heitorlessa?

ERROR:

     > pytest.fail("GitHub #300: LRUDict pop bug has been fixed.")
     E Failed: GitHub #300: LRUDict pop bug has been fixed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was an old bug in the implementation of LRUDict from OrderedDict. Let's skip for 3.11+ until we have more quality time to dive into refactoring this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a skip for Python 3.11+.

@boring-cyborg boring-cyborg bot added the documentation Improvements or additions to documentation label Jul 23, 2023
@leandrodamascena
Copy link
Contributor

Can't update the examples because cfn-lint still doesn't offer support to Python 3.11

linting::cloudformation..................................................Failed
- hook id: cloudformation
- exit code: 2

E3030 You must specify a valid value for Runtime (python3.11). Valid values are ["dotnet6", "dotnetcore1.0", "dotnetcore2.0", "dotnetcore2.1", "dotnetcore3.1", "go1.x", "java11", "java17", "java8", "java8.al2", "nodejs", "nodejs10.x", "nodejs12.x", "nodejs14.x", "nodejs16.x", "nodejs18.x", "nodejs4.3", "nodejs4.3-edge", "nodejs6.10", "nodejs8.10", "provided", "provided.al2", "python2.7", "python3.10", "python3.6", "python3.7", "python3.8", "python3.9", "ruby2.5", "ruby2.7", "ruby3.2"]
examples/batch_processing/sam/dynamodb_batch_processing.yaml:17:3

There is an issue to add support for this - aws-cloudformation/cfn-lint#2788

@leandrodamascena
Copy link
Contributor

Hello @rubenfonseca! This is a HUGE amount of incredible WORK! We can merge this PR merge after @heitorlessa help us with a small problem in one of our tests.

Congrats dude, this is an essential step for us. 🚀 ❤️

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@heitorlessa
Copy link
Contributor

Thank you @rubenfonseca and @leandrodamascena - fantastic work ;)

@leandrodamascena leandrodamascena self-requested a review July 24, 2023 12:16
@leandrodamascena leandrodamascena merged commit dfb9892 into develop Jul 24, 2023
@leandrodamascena leandrodamascena deleted the rf/python311 branch July 24, 2023 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation feature New feature or functionality github-actions Pull requests that update Github_actions code github-templates size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Maintenance: Support for Python 3.11
4 participants