Skip to content

Commit 010180e

Browse files
chore(ci): finish Python 3.15 support after the develop merge
- lock: bump only cffi, ddtrace, markupsafe, pyyaml and regex, the five locked packages without a Python 3.15 wheel - valkey-glide: dev dependency marked python_version < 3.15 until upstream ships cp315 wheels (valkey-io/valkey-glide#7321); drop the protobuf-compiler steps that the source build needed - CDK: use Runtime.PYTHON_3_15 now that aws-cdk-lib 2.277.0 has it, and bump the layer_v3 lock to the same version - canary: Python 3.15 added a positional fullname to SourceLoader.source_to_code; the bytecode hook now forwards whatever the loader passes
1 parent 38be62f commit 010180e

9 files changed

Lines changed: 672 additions & 424 deletions

File tree

‎.github/workflows/run-e2e-tests.yml‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,6 @@ jobs:
7171
run: |
7272
npm ci
7373
npx cdk --version
74-
# Valkey GLIDE currently needs a source build on Python 3.15.
75-
- name: Install native build dependencies for Python 3.15
76-
if: matrix.version == '3.15'
77-
run: |
78-
sudo apt-get update
79-
sudo apt-get install --yes --no-install-recommends protobuf-compiler
8074
- name: Install dependencies
8175
run: make dev-quality-code
8276
- name: Configure AWS credentials

‎layer_v3/layer/canary/bytecode_monitor.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@ def track_layer_compilation(layer_root: str = "/opt/python") -> Iterator[list[st
1515
source_to_code = SourceFileLoader.source_to_code
1616
prefix = f"{layer_root.rstrip('/')}/"
1717

18-
def track(loader, data, path, *, _optimize=-1):
18+
# Python 3.15 added a positional ``fullname`` to ``source_to_code``; forward whatever the loader passes
19+
def track(loader, data, path, *args, **kwargs):
1920
if path.startswith(prefix):
2021
compiled_files.append(path)
21-
return source_to_code(loader, data, path, _optimize=_optimize)
22+
return source_to_code(loader, data, path, *args, **kwargs)
2223

2324
SourceFileLoader.source_to_code = track # type: ignore[method-assign]
2425
try:

‎layer_v3/layer/canary_stack.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
Role,
2020
ServicePrincipal,
2121
)
22-
from aws_cdk.aws_lambda import Architecture, Code, Function, LayerVersion, Runtime, RuntimeFamily
22+
from aws_cdk.aws_lambda import Architecture, Code, Function, LayerVersion, Runtime
2323
from aws_cdk.aws_logs import RetentionDays
2424
from aws_cdk.aws_ssm import StringParameter
2525
from aws_cdk.custom_resources import Provider
@@ -143,7 +143,7 @@ def __init__(
143143
runtime = Runtime.PYTHON_3_14
144144
elif python_version == "python3.15":
145145
# Use the runtime name until CDK provides PYTHON_3_15.
146-
runtime = Runtime("python3.15", RuntimeFamily.PYTHON, supports_inline_code=True)
146+
runtime = Runtime.PYTHON_3_15
147147
else:
148148
raise ValueError("Unsupported Python version")
149149

‎layer_v3/layer/layer_stack.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
RemovalPolicy,
1313
Stack,
1414
)
15-
from aws_cdk.aws_lambda import Architecture, CfnLayerVersionPermission, Runtime, RuntimeFamily
15+
from aws_cdk.aws_lambda import Architecture, CfnLayerVersionPermission, Runtime
1616
from aws_cdk.aws_ssm import StringParameter
1717
from constructs import Construct
1818
from layer_constructors.layer_stack import LambdaPowertoolsLayerPythonV3
@@ -95,7 +95,7 @@ def __init__(
9595
python_version = Runtime.PYTHON_3_14
9696
if python_version == "python3.15":
9797
# Use the runtime name until CDK provides PYTHON_3_15.
98-
python_version = Runtime("python3.15", RuntimeFamily.PYTHON, supports_inline_code=True)
98+
python_version = Runtime.PYTHON_3_15
9999

100100
has_arm64_support = CfnParameter(
101101
self,

‎layer_v3/layer_constructors/tests/unit/test_new_cdk_constructor_stack.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def test_with_no_configuration_constructor():
3030
lambda_.Runtime.PYTHON_3_12,
3131
lambda_.Runtime.PYTHON_3_13,
3232
lambda_.Runtime.PYTHON_3_14,
33-
lambda_.Runtime("python3.15", lambda_.RuntimeFamily.PYTHON, supports_inline_code=True),
33+
lambda_.Runtime.PYTHON_3_15,
3434
],
3535
)
3636
def test_with_different_python_version_x86_64(python_version):
@@ -67,7 +67,7 @@ def test_with_different_python_version_x86_64(python_version):
6767
lambda_.Runtime.PYTHON_3_12,
6868
lambda_.Runtime.PYTHON_3_13,
6969
lambda_.Runtime.PYTHON_3_14,
70-
lambda_.Runtime("python3.15", lambda_.RuntimeFamily.PYTHON, supports_inline_code=True),
70+
lambda_.Runtime.PYTHON_3_15,
7171
],
7272
)
7373
def test_with_different_python_version_arm64(python_version):

‎layer_v3/uv.lock‎

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

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ redis = [
5858
"redis (>=4.4,<9.0)",
5959
]
6060
valkey = [
61-
"valkey-glide (>=1.3.5,<3.0)",
61+
"valkey-glide (>=1.3.5,<3.0) ; python_version < '3.15'",
6262
]
6363
jwt = [
6464
"pyjwt (>=2.14.0,<3.0.0)",

‎tests/e2e/utils/infrastructure.py‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
Function,
1919
LayerVersion,
2020
Runtime,
21-
RuntimeFamily,
2221
Tracing,
2322
)
2423
from filelock import FileLock
@@ -126,7 +125,7 @@ def create_lambda_functions(
126125
Runtime.PYTHON_3_12,
127126
Runtime.PYTHON_3_13,
128127
Runtime.PYTHON_3_14,
129-
Runtime("python3.15", RuntimeFamily.PYTHON, supports_inline_code=True),
128+
Runtime.PYTHON_3_15,
130129
],
131130
compatible_architectures=[architecture],
132131
code=Code.from_asset(path=layer_build),
@@ -270,7 +269,7 @@ def _determine_runtime_version(self) -> Runtime:
270269
return Runtime.PYTHON_3_14
271270
elif version.major == 3 and version.minor == 15:
272271
# Use the runtime name until CDK provides PYTHON_3_15.
273-
return Runtime("python3.15", RuntimeFamily.PYTHON, supports_inline_code=True)
272+
return Runtime.PYTHON_3_15
274273
else:
275274
raise ValueError(f"Unsupported Python version: {version}")
276275

0 commit comments

Comments
 (0)