Comments (6)
The intent is for chalice to support the same versions of python that AWS Lambda supports, which is currently python 2.7. So while possible to make it work, it could be confusing to work on your app in python3, but only to have it fail when deploying to lambda.
The more technical reason why supporting python3 is challenging in chalice is because chalice introspects your source code in order to configure things automatically for you, including importing your app.py
file so we can iterate through all your @app.route
declarations and parsing your app source code using the ast
and symtable
module for policy generation. So even if the chalice code base worked in python2/python3, the minute we try to import your app, and your app happens to have a "print 'foo'"
statement in it, it'll fail.
from chalice.
It is hard to believe that Amazon's premier entry in the hot "serverless" space still only supports the dying technology of Python 2. For those that haven't looked in recent years, support for Python 2 is due to end in 2020. Ubuntu doesn't even install it by default. A summary of the situation (with a nice graphical timeline showing nearly all other enviroments already ported to Python 3) is at http://www.python3statement.org/
Please reopen this bug until Chalice at least provides better support for projects that are trying to ensure Python 3 compatibility, i.e. having code that can be imported into a python 3 code base.
from chalice.
I was initially going to open such an issue but wondered if this compatibility was passed on for now since AWS Lambda only supports Python 2.7 anyway. I'd love for the CLI to support Python 3 as well, but could it lead some to write incompatible code inadvertently?
from chalice.
@daneah it can be addressed by splitting codebase into two repos - CLI and core.
from chalice.
@jamesls sounds absolutely reasonable. Mentioning it in the Readme would be helpful, as I just stumbled across it and had to find this bug report to understand whats going on.
from chalice.
I added a note in the README about supported python versions.
The plan is to support whatever versions AWS Lambda supports. So, for example, if lambda supports python3, and you want to use the python3 runtime, you'd simply create a virtualenv with python3. The chalice
code would ideally be able to run on both python2 and python3.
from chalice.
Related Issues (20)
- Unable to Render HTML Page with Chalice and Jinja2
- Why doesn't {proxy+} work as catchall ? HOT 1
- No way to set retry count on event bridge lambda (cron)?
- Support code signing for AWS Lambda
- AWS Chalice: Error on Redeploying @app.on_dynamodb_record Lambda
- Support for arm64 Graviton HOT 1
- Support for SSE streaming (OpenAI support)
- Config `log_retention_in_days` not working HOT 1
- Aws lambda unzipped size error - aws chalice HOT 3
- Update demo Applications to Python 3.10
- HTTPResponse.create_from_dict raise AttributeError when response body is None
- Support Python 3.12 HOT 2
- Failed to create CDK project in CDK >= 2.73.0
- Why middleware applied at blueprint level applies to whole application ?
- automatic layer config option doesn't work with cdk approach
- Export event classes (or at least BaseLambdaEvent) or provide typeshed stub library
- Update Terraform AWS Provider HOT 4
- CDK integration: Should infrastructure/*.out folders be committed to VCS? HOT 1
- Feature Request: Add SourceAccount on S3 Event
- Project Discontinued? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chalice.