Skip to content

Commit fd45093

Browse files
Added support for py 3.9 and update runtime before deployment
1 parent 305e55a commit fd45093

File tree

5 files changed

+17
-2
lines changed

5 files changed

+17
-2
lines changed

blambda/blambda-env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ elif [[ ${BLAMBDA_ENV} == 'blambda-3.7' ]]; then
3232
PYENV_PATH = '.pyenv/versions/3.7.5/lib/python3.7/'
3333
elif [[ ${BLAMBDA_ENV} == 'blambda-3.8' ]]; then
3434
PYENV_PATH = '.pyenv/versions/3.8.1/lib/python3.8/'
35+
elif [[ ${BLAMBDA_ENV} == 'blambda-3.9' ]]; then
36+
PYENV_PATH = '.pyenv/versions/3.9.13/lib/python3.9/'
3537
else
3638
echo "blambda couldn't read the python environment from manifest, aborting!"
3739
return 1

blambda/deploy.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,16 @@ def publish(name, role, zipfile, options, dryrun):
281281
print("Function Package: {} bytes".format(len(file_bytes)))
282282
if not dryrun:
283283
try:
284+
# TODO: Remove this once all py 3.8 lambdas are deployed on prod
285+
# Added below code to update lambda runtime first and then deploy it
286+
cprint("Updating lambda function configuration - todo: remove", 'yellow')
287+
response = client.update_function_configuration(
288+
FunctionName=name,
289+
**options
290+
)
291+
292+
time.sleep(5)
293+
284294
cprint("Updating lambda function code", 'yellow')
285295
response = client.update_function_code(
286296
FunctionName=name,

blambda/new.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
'python36': LambdaRuntime('python3.6', '.py', 'python/src'),
1616
'python37': LambdaRuntime('python3.7', '.py', 'python/src'),
1717
'python38': LambdaRuntime('python3.8', '.py', 'python/src'),
18+
'python39': LambdaRuntime('python3.9', '.py', 'python/src'),
1819
'coffee': LambdaRuntime('nodejs4.3', '.coffee', 'node/src')
1920
}
2021

blambda/utils/env_manager.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@
1717
py36 = LambdaRuntime('python3.6', '3.6.1', 'blambda-3.6')
1818
py37 = LambdaRuntime('python3.7', '3.7.5', 'blambda-3.7')
1919
py38 = LambdaRuntime('python3.8', '3.8.1', 'blambda-3.8')
20+
py39 = LambdaRuntime('python3.9', '3.9.13', 'blambda-3.9')
2021

2122
runtimes = {
2223
py27.name: py27,
2324
py36.name: py36,
2425
py37.name: py37,
25-
py38.name: py38
26+
py38.name: py38,
27+
py39.name: py39
2628
}
2729

2830
DEFAULT_RUNTIME = py36

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
author='Balihoo Developers',
77
author_email='devall@balihoo.com',
88
license='MIT',
9-
url='git@github.com:balihoo/fulfillment-lambda-functions.git',
9+
url='git+https://github.com/balihoo/fulfillment-lambda-functions.git',
1010
install_requires=['boto3', 'python-dateutil', 'requests', 'termcolor', 'lxml', 'beautifulsoup4'],
1111
packages=find_packages(exclude=['tests']),
1212
include_package_data=True,

0 commit comments

Comments
 (0)