fix: partially support Python3.14 #3859
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Allow the transform to be used in Python3.14, except GraphQLApi and Capacity Providers functionalities.
make prstill doesn't work, but the transform can be used successfully in Python 3.14 (if not using the above features)Issue #, if available
#3831
Description of changes
Add a try/except when importing the model classes. These classes are only used for Capacity Provider and GraphQLApi, so those items are still not supported when using Python3.14. But at least for now the rest of the transform works correctly.
I also removed a variable
resource_property_schemathat was being initialized for the Lambda Capacity Provider class definition, but it never changed value and it was used only once. So I replaced it with the value imported directly instead of saving it in an intermediate variable.I also updated
jsonschemaversion because the previous version wasn't supported in python3.14. I also removedcloudformation-clifrom dev dependencies, because it doesn't support latest versions of Python (and it's not actually used for anything)Description of how you validated changes
Manual tests
make pris still failing, because of course all the Capacity Provider and GraphQLApi tests that now are not working. And also a couple of other tests that import the model too, that are failing with pydantic v1. That's one of the reasons why we can't count python3.14 as really "supported" yet.Checklist
Examples?
Please reach out in the comments if you want to add an example. Examples will be
added to
sam initthrough aws/aws-sam-cli-app-templates.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.