Skip to content

Commit 21fc5f0

Browse files
ran-isenbergRan Isenberg
andauthored
feature: sync to Cookbook v6.0.0 python 3.13 (#28)
Co-authored-by: Ran Isenberg <ran.isenberg@ranthebuilder.cloud>
1 parent ee5736c commit 21fc5f0

File tree

10 files changed

+727
-725
lines changed

10 files changed

+727
-725
lines changed

README.md

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# AWS Serverless service cookiecutter (Python)
22

33
[![license](https://img.shields.io/github/license/ran-isenberg/cookiecutter-serverless-python)](https://github.com/ran-isenberg/cookiecutter-serverless-python/blob/master/LICENSE)
4-
![PythonSupport](https://img.shields.io/static/v1?label=python&message=3.12&color=blue?style=flat-square&logo=python)
4+
![PythonSupport](https://img.shields.io/static/v1?label=python&message=3.13&color=blue?style=flat-square&logo=python)
55
![version](https://img.shields.io/github/v/release/ran-isenberg/cookiecutter-serverless-python)
66
![github-star-badge](https://img.shields.io/github/stars/ran-isenberg/cookiecutter-serverless-python.svg?style=social)
77
![issues](https://img.shields.io/github/issues/ran-isenberg/cookiecutter-serverless-python)
@@ -11,24 +11,14 @@
1111

1212
This project can serve as a cookiecutter template for new Serverless services - CDK deployment code, pipeline and handler are covered with best practices built in.
1313
<br></br>
14-
The project is based on my [AWS Lambda Cookbook template project](https://github.com/ran-isenberg/aws-lambda-handler-cookbook) and synced to version 4.5.1:
14+
The project is based on my [AWS Lambda Cookbook template project](https://github.com/ran-isenberg/aws-lambda-handler-cookbook):
1515

16-
[![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)
17-
![PythonSupport](https://img.shields.io/static/v1?label=python&message=3.11&color=blue?style=flat-square&logo=python)
18-
[![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)
19-
![version](https://img.shields.io/github/v/release/ran-isenberg/aws-lambda-handler-cookbook)
20-
![github-star-badge](https://img.shields.io/github/stars/ran-isenberg/aws-lambda-handler-cookbook.svg?style=social)
21-
![issues](https://img.shields.io/github/issues/ran-isenberg/aws-lambda-handler-cookbook)
22-
23-
24-
**[📜Documentation](https://ran-isenberg.github.io/aws-lambda-handler-cookbook/)** | **[Blogs website](https://www.ranthebuilder.cloud)**
25-
> **Contact details | ran.isenberg@ranthebuilder.cloud**
2616
<br></br>
2717
## **Prerequisites**
2818

2919
* **Docker** - install [Docker](https://www.docker.com/). Required for the Lambda layer packaging process.
3020
* **[AWS CDK](cdk.md)** - Required for synth & deploying the AWS Cloudformation stack.
31-
* Python 3.12
21+
* Python 3.13
3222
* [poetry](https://pypi.org/project/poetry/) - Make sure to run ``poetry config --local virtualenvs.in-project true`` so all dependencies are installed in the project '.venv' folder.
3323
* For Windows based machines, use the Makefile_windows version (rename to Makefile). Default Makefile is for Mac/Linux.
3424
* Cookiecutter - install with pip/brew ``brew install cookiecutter`` or ``pip install cookiecutter``

{{cookiecutter.repo_name}}/.github/workflows/main-serverless-service.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ permissions:
77

88
env:
99
NODE_VERSION: "20"
10-
PYTHON_VERSION: "3.12"
10+
PYTHON_VERSION: "3.13"
1111
AWS_REGION: "us-east-1"
1212

1313
on:
@@ -34,16 +34,16 @@ jobs:
3434
BRANCH_NAME: ${{ github.ref }}
3535
REPO_NAME: ${{ github.repository }}
3636
- name: Check out repository code
37-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
37+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3838
- name: Install poetry
3939
run: pipx install poetry
4040
- name: Set up Python
41-
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
41+
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
4242
with:
4343
python-version: ${{ env.PYTHON_VERSION }}
4444
cache: "poetry" # NOTE: poetry must be installed before this step, or else cache doesn't work
4545
- name: Set up Node
46-
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
46+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
4747
with:
4848
node-version: ${{ env.NODE_VERSION }}
4949
cache: "npm"
@@ -71,7 +71,7 @@ jobs:
7171
env:
7272
ENVIRONMENT: staging # Custom environment variable
7373
- name: Codecov
74-
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
74+
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
7575
with:
7676
token: ${{ secrets.CODECOV_TOKEN }}
7777
files: ./coverage.xml
@@ -100,16 +100,16 @@ jobs:
100100
BRANCH_NAME: ${{ github.ref }}
101101
REPO_NAME: ${{ github.repository }}
102102
- name: Check out repository code
103-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
103+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
104104
- name: Install poetry
105105
run: pipx install poetry
106106
- name: Set up Python
107-
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
107+
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
108108
with:
109109
python-version: ${{ env.PYTHON_VERSION }}
110110
cache: "poetry" # NOTE: poetry must be installed before this step, or else cache doesn't work
111111
- name: Set up Node
112-
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
112+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
113113
with:
114114
node-version: ${{ env.NODE_VERSION }}
115115
cache: "npm"
@@ -139,13 +139,13 @@ jobs:
139139
if: contains('refs/heads/main', github.ref)
140140
steps:
141141
- name: Check out repository code
142-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
142+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
143143
- name: Set up Python
144-
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
144+
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
145145
with:
146146
python-version: ${{ env.PYTHON_VERSION }}
147147
- name: Set up Node
148-
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
148+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
149149
with:
150150
node-version: ${{ env.NODE_VERSION }}
151151
cache: "npm"

{{cookiecutter.repo_name}}/.github/workflows/pr-serverless-service.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ permissions:
77

88
env:
99
NODE_VERSION: "20"
10-
PYTHON_VERSION: "3.12"
10+
PYTHON_VERSION: "3.13"
1111
AWS_REGION: "us-east-1"
1212

1313
on:
@@ -31,11 +31,11 @@ jobs:
3131
BRANCH_NAME: ${{ github.ref }}
3232
REPO_NAME: ${{ github.repository }}
3333
- name: Check out repository code
34-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
34+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3535
- name: Install poetry
3636
run: pipx install poetry
3737
- name: Set up Python
38-
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
38+
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
3939
with:
4040
python-version: ${{ env.PYTHON_VERSION }}
4141
cache: "poetry" # NOTE: poetry must be installed before this step, or else cache doesn't work
@@ -55,16 +55,16 @@ jobs:
5555
id-token: write # required for requesting the JWT (GitHub OIDC)
5656
steps:
5757
- name: Check out repository code
58-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
58+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5959
- name: Install poetry
6060
run: pipx install poetry
6161
- name: Set up Python
62-
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
62+
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
6363
with:
6464
python-version: ${{ env.PYTHON_VERSION }}
6565
cache: "poetry" # NOTE: poetry must be installed before this step, or else cache doesn't work
6666
- name: Set up Node
67-
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
67+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
6868
with:
6969
node-version: ${{ env.NODE_VERSION }}
7070
cache: "npm"
@@ -87,7 +87,7 @@ jobs:
8787
# NOTE: these run unit and integration tests
8888
# we can look into coverage collection only later to make it faster and less brittle (--collect-only)
8989
- name: Check OpenAPI Spec breaking action
90-
uses: oasdiff/oasdiff-action/breaking@a2ff6682b27d175162a74c09ace8771bd3d512f8 # v0.0.16
90+
uses: oasdiff/oasdiff-action/breaking@1c611ffb1253a72924624aa4fb662e302b3565d3 # v0.0.16
9191
with:
9292
base: https://raw.githubusercontent.com/ran-isenberg/aws-lambda-handler-cookbook/main/docs/swagger/openapi.json
9393
revision: ./docs/swagger/openapi.json
@@ -96,7 +96,7 @@ jobs:
9696
- name: Code coverage tests
9797
run: make coverage-tests
9898
- name: Codecov
99-
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
99+
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
100100
with:
101101
token: ${{ secrets.CODECOV_TOKEN }}
102102
files: ./coverage.xml

{{cookiecutter.repo_name}}/.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ repos:
2626
exclude: "^(?!helpers/)"
2727
- repo: https://github.com/astral-sh/ruff-pre-commit
2828
# Ruff version.
29-
rev: v0.6.8
29+
rev: v0.7.3
3030
hooks:
3131
# Run the Ruff linter.
3232
- id: ruff

{{cookiecutter.repo_name}}/cdk/setup.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@
66
here = path.abspath(path.dirname(__file__))
77

88
setup(
9-
name='{{cookiecutter.service_name}}-cdk',
10-
version='3.1',
11-
description='CDK code for deploying the serverless service',
9+
name="{{cookiecutter.service_name}}-cdk",
10+
version="3.1",
11+
description="CDK code for deploying the serverless service",
1212
classifiers=[
13-
'Intended Audience :: Developers',
14-
'Topic :: Software Development :: Build Tools',
15-
'Programming Language :: Python :: 3.12',
13+
"Intended Audience :: Developers",
14+
"Topic :: Software Development :: Build Tools",
15+
"Programming Language :: Python :: 3.13",
1616
],
17-
url='https://github.com/ran-isenberg/aws-lambda-handler-cookbook',
18-
author='{{cookiecutter.author}}',
19-
author_email='{{cookiecutter.email}}',
20-
packages=find_packages(exclude=['contrib', 'docs', 'tests']),
21-
package_data={'': ['*.json']},
17+
url="https://github.com/ran-isenberg/aws-lambda-handler-cookbook",
18+
author="{{cookiecutter.author}}",
19+
author_email="{{cookiecutter.email}}",
20+
packages=find_packages(exclude=["contrib", "docs", "tests"]),
21+
package_data={"": ["*.json"]},
2222
include_package_data=True,
23-
python_requires='>=3.12',
23+
python_requires=">=3.13",
2424
install_requires=[],
2525
)

{{cookiecutter.repo_name}}/cdk/{{cookiecutter.service_name}}/api_construct.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def _build_common_layer(self) -> PythonLayerVersion:
102102
self,
103103
f'{self.id_}{constants.LAMBDA_LAYER_NAME}',
104104
entry=constants.COMMON_LAYER_BUILD_FOLDER,
105-
compatible_runtimes=[_lambda.Runtime.PYTHON_3_12],
105+
compatible_runtimes=[_lambda.Runtime.PYTHON_3_13],
106106
removal_policy=RemovalPolicy.DESTROY,
107107
)
108108

@@ -117,7 +117,7 @@ def _add_post_lambda_integration(
117117
lambda_function = _lambda.Function(
118118
self,
119119
constants.CREATE_LAMBDA,
120-
runtime=_lambda.Runtime.PYTHON_3_12,
120+
runtime=_lambda.Runtime.PYTHON_3_13,
121121
code=_lambda.Code.from_asset(constants.BUILD_FOLDER),
122122
handler='{{cookiecutter.service_name}}.handlers.handle_create_order.lambda_handler',
123123
environment={

{{cookiecutter.repo_name}}/package-lock.json

Lines changed: 6 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"dependencies": {
3-
"aws-cdk": "2.160.0"
3+
"aws-cdk": "2.167.0"
44
}
55
}

0 commit comments

Comments
 (0)