Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Python 3.12 #1761

Closed
wants to merge 1 commit into from
Closed

Conversation

robertreservix
Copy link

Description

Add support for Python 3.12

Motivation and Context

  • Python 3.12 is supported since 14 DEC 2023 by AWS
  • Python 3.12 is supported soon (or yet :) ) by serverless

How Has This Been Tested?

There is a warning, coming probably from serverless, but nevertheless I can work with Python 3.12 using this fork

❯ serverless offline
Running "serverless" from node_modules

Warning: Invalid configuration encountered
  at 'provider.runtime': must be equal to one of the allowed values [dotnet6, go1.x, java17, java11, java8, java8.al2, nodejs14.x, nodejs16.x, nodejs18.x, nodejs20.x, provided, provided.al2, provided.al2023, python3.7, python3.8, python3.9, python3.10, python3.11, ruby2.7, ruby3.2]

Learn more about configuration validation here: http://slss.io/configuration-validation

Starting Offline at stage dev (<some-aws-region>)

Offline [http for lambda] listening on http://localhost:3002
Function names exposed for local invocation by aws-sdk:
           * main: <some-function-name>

   ┌────────────────────────────────────────────────────────────────────────┐
   │                                                                        │
   │   POST | http://localhost:3000/                                        │
   │   POST | http://localhost:3000/2015-03-31/functions/main/invocations   │
   │                                                                        │
   └────────────────────────────────────────────────────────────────────────┘

Server ready: http://localhost:3000 🚀

Screenshots (if appropriate):

@nikitajz
Copy link

Seems a duplicate of serverless/serverless#12300

@robertreservix
Copy link
Author

@nikitajz Will the changes from serverless/serverless automatically built into this project?
I thought that the versions are hard coded, but I might be wrong.

@nikitajz
Copy link

@robertreservix seems you're right - it's more a duplicate of the code (configuration) rather than GH issue.
I didn't pay enough attention that it's a separate project since I left a comment when was reviewing serverless repo issues

@DorianMazur
Copy link
Collaborator

Thank you @robertreservix for the PR.
This is no longer needed I think. I just merged a PR that adds support for python3.12 - #1755

@DorianMazur
Copy link
Collaborator

Actually I need to reopen this, because serverless doesn't support python 3.12 - serverless/serverless#12300

@DorianMazur DorianMazur reopened this Apr 24, 2024
@mwidera
Copy link

mwidera commented Jul 3, 2024

Hello just wanted to ask whether this will be merged anytime soon?
As a workaround right now I'm using: https://www.npmjs.com/package/patch-package
With this patch:

diff --git a/node_modules/serverless-offline/src/config/supportedRuntimes.js b/node_modules/serverless-offline/src/config/supportedRuntimes.js
index 9fe7f0e..c0fbc3a 100644
--- a/node_modules/serverless-offline/src/config/supportedRuntimes.js
+++ b/node_modules/serverless-offline/src/config/supportedRuntimes.js
@@ -20,6 +20,7 @@ export const supportedRuntimesArchitecture = {
   "python3.9": [ARM64, X86_64],
   "python3.10": [ARM64, X86_64],
   "python3.11": [ARM64, X86_64],
+  "python3.12": [ARM64, X86_64],
   "ruby2.7": [ARM64, X86_64],
   "ruby3.2": [ARM64, X86_64],
   java8: [X86_64],
@@ -62,6 +63,7 @@ export const supportedPython = new Set([
   "python3.9",
   "python3.10",
   "python3.11",
+  "python3.12",
 ])

@DorianMazur
Copy link
Collaborator

@mwidera I added it here ab8565a

@DorianMazur DorianMazur closed this Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants