Skip to content

Commit

Permalink
feature: upgrade python 3.12 (#779)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Ran Isenberg <[email protected]>
  • Loading branch information
ran-isenberg and Ran Isenberg authored Dec 15, 2023
1 parent 9d6f35e commit 3282b53
Show file tree
Hide file tree
Showing 12 changed files with 146 additions and 187 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main-serverless-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ permissions:
contents: read

env:
NODE_VERSION: "18"
PYTHON_VERSION: "3.11"
NODE_VERSION: "20"
PYTHON_VERSION: "3.12"
AWS_REGION: "us-east-1"

on:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr-serverless-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ permissions:
contents: read

env:
NODE_VERSION: "18"
PYTHON_VERSION: "3.11"
NODE_VERSION: "20"
PYTHON_VERSION: "3.12"
AWS_REGION: "us-east-1"

on:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ repos:
exclude: "^(?!helpers/)"
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.1.7
rev: v0.1.8
hooks:
# Run the Ruff linter.
- id: ruff
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# AWS Lambda Handler Cookbook (Python)

[![license](https://img.shields.io/github/license/ran-isenberg/aws-lambda-handler-cookbook)](https://github.com/ran-isenberg/aws-lambda-handler-cookbook/blob/master/LICENSE)
![PythonSupport](https://img.shields.io/static/v1?label=python&message=3.11&color=blue?style=flat-square&logo=python)
![PythonSupport](https://img.shields.io/static/v1?label=python&message=3.12&color=blue?style=flat-square&logo=python)
[![codecov](https://codecov.io/gh/ran-isenberg/aws-lambda-handler-cookbook/branch/main/graph/badge.svg?token=P2K7K4KICF)](https://codecov.io/gh/ran-isenberg/aws-lambda-handler-cookbook)
![version](https://img.shields.io/github/v/release/ran-isenberg/aws-lambda-handler-cookbook)
![github-star-badge](https://img.shields.io/github/stars/ran-isenberg/aws-lambda-handler-cookbook.svg?style=social)
Expand Down
4 changes: 2 additions & 2 deletions cdk/service/api_construct.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def _build_common_layer(self) -> PythonLayerVersion:
self,
f'{self.id_}{constants.LAMBDA_LAYER_NAME}',
entry=constants.COMMON_LAYER_BUILD_FOLDER,
compatible_runtimes=[_lambda.Runtime.PYTHON_3_11],
compatible_runtimes=[_lambda.Runtime.PYTHON_3_12],
removal_policy=RemovalPolicy.DESTROY,
)

Expand All @@ -97,7 +97,7 @@ def _add_post_lambda_integration(
lambda_function = _lambda.Function(
self,
constants.CREATE_LAMBDA,
runtime=_lambda.Runtime.PYTHON_3_11,
runtime=_lambda.Runtime.PYTHON_3_12,
code=_lambda.Code.from_asset(constants.BUILD_FOLDER),
handler='service.handlers.handle_create_order.lambda_handler',
environment={
Expand Down
2 changes: 1 addition & 1 deletion cdk/service/service_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ def _add_security_tests(self) -> None:
{'id': 'AwsSolutions-APIG6', 'reason': 'not mandatory in a sample template'},
{'id': 'AwsSolutions-APIG4', 'reason': 'authorization not mandatory in a sample template'},
{'id': 'AwsSolutions-COG4', 'reason': 'not using cognito'},
{'id': 'AwsSolutions-L1', 'reason': 'Python 3.12 not out yet'},
{'id': 'AwsSolutions-L1', 'reason': 'False positive'},
],
)
4 changes: 2 additions & 2 deletions cdk/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
classifiers=[
'Intended Audience :: Developers',
'Topic :: Software Development :: Build Tools',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
],
url='https://github.com/ran-isenberg/aws-lambda-handler-cookbook',
author='Ran Isenberg',
author_email='[email protected]',
packages=find_packages(exclude=['contrib', 'docs', 'tests']),
package_data={'': ['*.json']},
include_package_data=True,
python_requires='>=3.11',
python_requires='>=3.12',
install_requires=[],
)
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def _build_lambda_function(self, role: iam.Role, db: dynamodb.Table, appconfig_a
return _lambda.Function(
self,
'ServicePost',
runtime=_lambda.Runtime.PYTHON_3_11,
runtime=_lambda.Runtime.PYTHON_3_12,
code=_lambda.Code.from_asset(constants.BUILD_FOLDER),
handler='service.handlers.create_order.create_order',
environment={
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"dependencies": {
"aws-cdk": "2.114.1"
"aws-cdk": "2.115.0"
}
}
Loading

0 comments on commit 3282b53

Please sign in to comment.