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

upgrade to python 3 #20

Open
mmerickel opened this issue Apr 5, 2022 · 4 comments
Open

upgrade to python 3 #20

mmerickel opened this issue Apr 5, 2022 · 4 comments

Comments

@mmerickel
Copy link

Current module does not work any longer on macOS 12.3 which removed the python command. Need to update to use python3 which should work universally across most systems via PEP 394.

@mmerickel
Copy link
Author

I guess just as a quick followup I switched over to https://registry.terraform.io/modules/terraform-aws-modules/lambda/aws/latest instead of this package and found that it was more up to date and feature compatible for my use cases incase it helps anyone else.

@raymondbutcher
Copy link
Owner

Thanks, I'll have to read PEP 394 and see what makes sense. The actual Python code used in this module is compatible with Python 2 and 3 so I'd prefer to support both if it's not difficult.

The main reason one might use this module over https://registry.terraform.io/modules/terraform-aws-modules/lambda/aws/latest is that this module doesn't require any of the build toolchain (pip/npm/go/etc) or Docker to be available on the machine running Terraform. The Lambda package gets built inside a Lambda or CodeBuild environment.

@mmerickel
Copy link
Author

mmerickel commented Apr 20, 2022

The actual Python code used in this module is compatible with Python 2 and 3 so I'd prefer to support both if it's not difficult.

Python 2 is very dead so I'd argue against trying to continue supporting it. Regardless, the pep basically calls out that python3 is the command to use for Python 3. Python 2 is not installed by default on most modern operating systems so just switching over to using python3 is the best answer. Alternatively you can try to detect the command but I'd push for just using the python3 command as it will work in the majority of scenarios.

@jamespamplin
Copy link
Contributor

We just had this issue on Terraform Cloud. Fixed by changing python to python3 for the external scripts in a fork of this repo and on terraform-archive-stable.

Happy to raise PRs for the fixes, but I'm unsure if the module should retain backwards compatibility with the python 2 executable.

Thoughts?

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

No branches or pull requests

3 participants