Skip to content

Commit 9ee3ff8

Browse files
ran-isenbergRan Isenberg
andauthored
feature: move to python 3.9 (#221)
Co-authored-by: Ran Isenberg <ran.isenberg@ranthebuilder.cloud>
1 parent a7c99d8 commit 9ee3ff8

File tree

10 files changed

+40
-47
lines changed

10 files changed

+40
-47
lines changed

.github/workflows/python-app.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121
uses: actions/checkout@v3
2222
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
2323
- uses: actions/checkout@v3
24-
- name: Set up Python 3.8
24+
- name: Set up Python 3.9
2525
uses: actions/setup-python@v4
2626
with:
27-
python-version: "3.8"
27+
python-version: "3.9"
2828
- name: Install dependencies
2929
run: |
3030
python -m pip install --upgrade pip
@@ -69,10 +69,10 @@ jobs:
6969
uses: actions/checkout@v3
7070
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
7171
- uses: actions/checkout@v3
72-
- name: Set up Python 3.8
72+
- name: Set up Python 3.9
7373
uses: actions/setup-python@v4
7474
with:
75-
python-version: "3.8"
75+
python-version: "3.9"
7676
- name: Generate docs
7777
run: |
7878
python -m pip install --upgrade pip

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ pre-commit:
2323
pre-commit run -a
2424

2525
deps:
26-
pipenv lock --dev-only -r > dev_requirements.txt
27-
pipenv lock -r > lambda_requirements.txt
26+
pipenv requirements --dev > dev_requirements.txt
27+
pipenv requirements > lambda_requirements.txt
2828

2929
unit:
3030
pytest tests/unit --cov-config=.coveragerc --cov=service --cov-report xml
@@ -46,7 +46,7 @@ pipeline-tests:
4646
deploy:
4747
make deps
4848
mkdir -p .build/lambdas ; cp -r service .build/lambdas
49-
mkdir -p .build/common_layer ; pipenv lock -r > .build/common_layer/requirements.txt
49+
mkdir -p .build/common_layer ; pipenv requirements > .build/common_layer/requirements.txt
5050
cdk deploy --app="python3 ${PWD}/cdk/aws_lambda_handler_cookbook/app.py" -require-approval=True
5151

5252
destroy:

Pipfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ pydantic = {extras = ["email"],version = "*"}
2929
aws-lambda-powertools = "*"
3030

3131
[requires]
32-
python_version = "3.8"
32+
python_version = "3.9"

Pipfile.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# AWS Lambda Handler Cookbook (Python)
33

44
[![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)
5-
![PythonSupport](https://img.shields.io/static/v1?label=python&message=3.8&color=blue?style=flat-square&logo=python)
5+
![PythonSupport](https://img.shields.io/static/v1?label=python&message=3.9&color=blue?style=flat-square&logo=python)
66
[![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)
77
![version](https://img.shields.io/github/v/release/ran-isenberg/aws-lambda-handler-cookbook)
88
![github-star-badge](https://img.shields.io/github/stars/ran-isenberg/aws-lambda-handler-cookbook.svg?style=social)

cdk/aws_lambda_handler_cookbook/service_stack/cookbook_construct.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ def _build_common_layer(self) -> PythonLayerVersion:
5858
self,
5959
'CommonLayer',
6060
entry=constants.COMMON_LAYER_BUILD_FOLDER,
61-
compatible_runtimes=[_lambda.Runtime.PYTHON_3_8],
61+
compatible_runtimes=[_lambda.Runtime.PYTHON_3_9],
6262
removal_policy=RemovalPolicy.DESTROY,
6363
)
6464

6565
def __add_post_lambda_integration(self, api_name: aws_apigateway.Resource, role: iam.Role):
6666
lambda_function = _lambda.Function(
6767
self,
6868
'CookBookPost',
69-
runtime=_lambda.Runtime.PYTHON_3_8,
69+
runtime=_lambda.Runtime.PYTHON_3_9,
7070
code=_lambda.Code.from_asset(constants.BUILD_FOLDER),
7171
handler='service.handlers.my_handler.my_handler',
7272
environment={

cdk/setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@
1313
classifiers=[
1414
'Intended Audience :: Developers',
1515
'Topic :: Software Development :: Build Tools',
16-
'Programming Language :: Python :: 3.8',
16+
'Programming Language :: Python :: 3.9',
1717
],
1818
url='https://github.com/ran-isenberg/aws-lambda-handler-cookbook',
1919
author='Ran Isenberg',
2020
author_email='ran.isenberg@ranthebuilder.cloud',
2121
packages=find_packages(exclude=['contrib', 'docs', 'tests']),
2222
package_data={'': ['*.json']},
2323
include_package_data=True,
24-
python_requires='>=3.8',
24+
python_requires='>=3.9',
2525
install_requires=[
2626
'aws-cdk-lib>=2.0.0',
2727
'constructs>=10.0.0',
28-
'aws-cdk.aws-lambda-python-alpha==2.37.1-alpha.0',
28+
'aws-cdk.aws-lambda-python-alpha==2.38.0-alpha.0',
2929
],
3030
)

dev_requirements.txt

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
1-
#
2-
# These requirements were autogenerated by pipenv
3-
# To regenerate from the project's Pipfile, run:
4-
#
5-
# pipenv lock --requirements --dev-only
6-
#
7-
81
-i https://pypi.org/simple
9-
-e ./cdk
10-
-e ./cdk
112
attrs==22.1.0; python_version >= '3.5'
123
aws-cdk-lib==2.38.0; python_version ~= '3.7'
13-
aws-cdk.aws-lambda-python-alpha==2.37.1a0; python_version ~= '3.7'
4+
aws-cdk.aws-lambda-python-alpha==2.38.0a0; python_version ~= '3.7'
5+
-e ./cdk
146
boto3==1.24.54; python_version >= '3.7'
157
botocore==1.27.54; python_version >= '3.7'
168
cattrs==1.10.0
@@ -20,6 +12,7 @@ charset-normalizer==2.1.0; python_version >= '3.6'
2012
click==8.1.3; python_version >= '3.7'
2113
colorama==0.4.5; python_version >= '3.5'
2214
constructs==10.1.79; python_version ~= '3.7'
15+
-e ./cdk
2316
coverage[toml]==6.4.4; python_version >= '3.7'
2417
distlib==0.3.5
2518
filelock==3.8.0; python_version >= '3.7'
@@ -41,10 +34,10 @@ markdown==3.3.7; python_version >= '3.6'
4134
markupsafe==2.1.1; python_version >= '3.7'
4235
mccabe==0.7.0; python_version >= '3.6'
4336
mergedeep==1.3.4; python_version >= '3.6'
37+
mkdocs==1.3.1; python_version >= '3.6'
4438
mkdocs-git-revision-date-plugin==0.3.2
45-
mkdocs-material-extensions==1.0.3; python_version >= '3.6'
4639
mkdocs-material==8.4.0
47-
mkdocs==1.3.1; python_version >= '3.6'
40+
mkdocs-material-extensions==1.0.3; python_version >= '3.6'
4841
nodeenv==1.7.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6'
4942
packaging==21.3; python_version >= '3.6'
5043
platformdirs==2.5.2; python_version >= '3.7'
@@ -57,15 +50,15 @@ pyflakes==2.5.0; python_version >= '3.6'
5750
pygments==2.13.0; python_version >= '3.6'
5851
pymdown-extensions==9.5; python_version >= '3.7'
5952
pyparsing==3.0.9; python_full_version >= '3.6.8'
53+
pytest==7.1.2
6054
pytest-cov==3.0.0
6155
pytest-html==3.1.1
6256
pytest-metadata==2.0.2; python_version >= '3.7' and python_version < '4.0'
6357
pytest-mock==3.8.2
64-
pytest==7.1.2
6558
python-dateutil==2.8.2; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
6659
python-dotenv==0.20.0
67-
pyyaml-env-tag==0.1; python_version >= '3.6'
6860
pyyaml==6.0; python_version >= '3.6'
61+
pyyaml-env-tag==0.1; python_version >= '3.6'
6962
radon==5.1.0
7063
requests==2.28.1; python_version >= '3.7' and python_version < '4.0'
7164
s3transfer==0.6.0; python_version >= '3.7'
@@ -76,9 +69,16 @@ toml==0.10.2; python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2,
7669
tomli==2.0.1; python_version >= '3.7'
7770
typeguard==2.13.3; python_full_version >= '3.5.3'
7871
typing-extensions==4.3.0; python_version >= '3.7'
79-
urllib3==1.26.11; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5' and python_version < '4'
72+
urllib3==1.26.11; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5' and python_full_version < '4.0.0'
8073
virtualenv==20.16.3; python_version >= '3.6'
8174
watchdog==2.1.9; python_version >= '3.6'
8275
xenon==0.9.0
8376
yapf==0.32.0
8477
zipp==3.8.1; python_version >= '3.7'
78+
aws-lambda-powertools==1.27.0
79+
aws-xray-sdk==2.10.0
80+
dnspython==2.2.1; python_version >= '3.6' and python_full_version < '4.0.0'
81+
email-validator==1.2.1
82+
fastjsonschema==2.16.1
83+
pydantic[email]==1.9.2
84+
wrapt==1.14.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'

docs/getting_started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: AWS Lambda Cookbook Project Getting started
66

77
* **Docker** - install [Docker](https://www.docker.com/){target="_blank"}. Required for the Lambda layer packaging process.
88
* **[AWS CDK](cdk.md)** - Required for synth & deploying the AWS Cloudformation stack.
9-
* Python 3.8
9+
* Python 3.9
1010

1111
## **Creating a Virtual Python Environment**
1212

lambda_requirements.txt

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
1-
#
2-
# These requirements were autogenerated by pipenv
3-
# To regenerate from the project's Pipfile, run:
4-
#
5-
# pipenv lock --requirements
6-
#
7-
81
-i https://pypi.org/simple
92
aws-lambda-powertools==1.27.0
103
aws-xray-sdk==2.10.0
114
boto3==1.24.54; python_version >= '3.7'
125
botocore==1.27.54; python_version >= '3.7'
13-
dnspython==2.2.1; python_version >= '3.6' and python_version < '4'
6+
dnspython==2.2.1; python_version >= '3.6' and python_full_version < '4.0.0'
147
email-validator==1.2.1
158
fastjsonschema==2.16.1
169
idna==3.3; python_version >= '3.5'
@@ -20,5 +13,5 @@ python-dateutil==2.8.2; python_version >= '2.7' and python_version not in '3.0,
2013
s3transfer==0.6.0; python_version >= '3.7'
2114
six==1.16.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
2215
typing-extensions==4.3.0; python_version >= '3.7'
23-
urllib3==1.26.11; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5' and python_version < '4'
16+
urllib3==1.26.11; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5' and python_full_version < '4.0.0'
2417
wrapt==1.14.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'

0 commit comments

Comments
 (0)