From 24f4b10e9c9cf152da91ea1b11e42921027d43bd Mon Sep 17 00:00:00 2001 From: Christian Kothe Date: Fri, 14 May 2021 22:01:02 -0700 Subject: [PATCH 1/2] Add RestAPI.Stage ref to ApiGatewayCustomDomainMapping This is intended to ensure that the mapping is created only after the stage exists. --- chalice/package.py | 2 +- tests/unit/test_package.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/chalice/package.py b/chalice/package.py index 6d3e12a9a..dd0ed2aab 100644 --- a/chalice/package.py +++ b/chalice/package.py @@ -735,7 +735,7 @@ def _add_domain_name(self, resource, template): 'DomainName': {'Ref': 'ApiGatewayCustomDomain'}, 'RestApiId': {'Ref': 'RestAPI'}, 'BasePath': domain_name.api_mapping.mount_path, - 'Stage': resource.api_gateway_stage, + 'Stage': {'Ref': 'RestAPI.Stage'}, } } diff --git a/tests/unit/test_package.py b/tests/unit/test_package.py index fd3c89f88..0516e9ed6 100644 --- a/tests/unit/test_package.py +++ b/tests/unit/test_package.py @@ -1646,7 +1646,7 @@ def test_can_generate_custom_domain_name(self, sample_app): 'Properties': { 'DomainName': {'Ref': 'ApiGatewayCustomDomain'}, 'RestApiId': {'Ref': 'RestAPI'}, - 'Stage': config.api_gateway_stage, + 'Stage': {'Ref': 'RestAPI.Stage'}, 'BasePath': '(none)', } } @@ -1680,7 +1680,7 @@ def test_can_generate_domain_for_regional_endpoint(self, sample_app): 'Properties': { 'DomainName': {'Ref': 'ApiGatewayCustomDomain'}, 'RestApiId': {'Ref': 'RestAPI'}, - 'Stage': config.api_gateway_stage, + 'Stage': {'Ref': 'RestAPI.Stage'}, 'BasePath': '(none)', } } From c709ab77c83511a96bac0ff54b0b397f7cb5f8ed Mon Sep 17 00:00:00 2001 From: Sean Mullen Date: Wed, 3 Dec 2025 11:13:03 -0800 Subject: [PATCH 2/2] added support for -> py3.11 --- chalice/config.py | 10 +++++++++- chalice/deploy/packager.py | 4 ++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/chalice/config.py b/chalice/config.py index dbd5dce04..f27d79d12 100644 --- a/chalice/config.py +++ b/chalice/config.py @@ -163,7 +163,15 @@ def lambda_python_version(self): return 'python3.6' elif (major, minor) <= (3, 7): return 'python3.7' - return 'python3.8' + elif (major, minor) <= (3, 8): + return 'python3.8' + elif (major, minor) <= (3, 9): + return 'python3.9' + elif (major, minor) <= (3, 10): + return 'python3.10' + elif (major, minor) <= (3, 11): + return 'python3.11' + return 'python3.12' @property def layers(self): diff --git a/chalice/deploy/packager.py b/chalice/deploy/packager.py index b2ccce979..dd29f02fc 100644 --- a/chalice/deploy/packager.py +++ b/chalice/deploy/packager.py @@ -77,6 +77,10 @@ class BaseLambdaDeploymentPackager(object): 'python3.6': 'cp36m', 'python3.7': 'cp37m', 'python3.8': 'cp38', + 'python3.9': 'cp39', + 'python3.10': 'cp310', + 'python3.11': 'cp311', + 'python3.12': 'cp312', } def __init__(self, osutils, dependency_builder, ui):