Repository navigation
Support Python applications as web functions - #521
Merged
Merged
Conversation
GrahamCampbell
force-pushed
the
web-functions-python315
branch
from
November 26, 2026 21:06
70192da to
eea0839
Compare
GrahamCampbell
force-pushed
the
web-functions-python315
branch
from
November 26, 2026 21:35
a6bbe98 to
435cc21
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lambda offers the
python3.15runtime for web functions as a public preview, but osls only accepts the Node.js runtimes, and its handling of the entry point is specific to Node.js. A Python web function is an ASGI or WSGI application that Lambda serves, named asmodule:callablein theAWS_LAMBDA_PYTHON_ENTRYPOINTenvironment variable, withmain:appas the default. This addspython3.15to the web function runtimes and keepsentryPointas the one property that names what Lambda loads: a file path for Node.js as before, and Lambda's ownmodule:callablestring for Python, optionally prefixed withasgi:orwsgi:, which osls passes on unchanged. A property with one format per runtime followshandleron functions, and avoids osls-only properties that would have to track a preview.Validation follows what Lambda accepts in practice, which its documentation only partly covers: dotted modules, packages and attribute paths work, while a
.pyextension, a factory call or an upper-case prefix deploy successfully and then fail every request with status 502. The same happens when the module is missing, so packaging fails when the root of the package has neither the file nor the package of the module, as it already does for a missing Node.js entry file, also for apackage.artifact. Both entry point variables are rejected inenvironmenton every web function, sinceprovider.environmentis shared by the web functions of both languages.invoke localpoints to an ASGI or WSGI server for a Python web function.The web functions guide gains a section on Python applications and on packaging their dependencies, which osls does not install: they have to be at the root of the package, built for Linux on arm64. Unlike the Python runtime of functions, this runtime does not include
boto3. The default runtime staysnodejs26.x, so a Python web function has to setruntime.