Coder Social home page Coder Social logo

CLI not compatible with Python 3+ about chalice HOT 6 CLOSED

aws avatar aws commented on May 23, 2024 3
CLI not compatible with Python 3+

from chalice.

Comments (6)

jamesls avatar jamesls commented on May 23, 2024 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.

nealmcb avatar nealmcb commented on May 23, 2024 1

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.

daneah avatar daneah commented on May 23, 2024

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.

denismakogon avatar denismakogon commented on May 23, 2024

@daneah it can be addressed by splitting codebase into two repos - CLI and core.

from chalice.

bbock avatar bbock commented on May 23, 2024

@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.

jamesls avatar jamesls commented on May 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.