apache / openwhisk-runtime-python

Apache OpenWhisk Runtime Python supports Apache OpenWhisk functions written in Python
https://openwhisk.apache.org/
Apache License 2.0
51 stars 70 forks source link

convert scripts to python3 #87

Closed ac427 closed 3 years ago

ac427 commented 4 years ago

looks like most of the scripts run under python2. since python2 is history is there any work in progress to convert them to python3? my python3 scripts can't run as sys.path shows all python2 stuff and if I update it I run into weird issues.

I will also check if I am make any prs, but would like to know if anyone is working on it?

rabbah commented 4 years ago

Hi @ac427.

Which scripts in particular? Scanning the repo for python files, I find the list below.

./core/python2ActionLoop/lib/launcher.py
./core/python3Action/pythonrunner.py
./core/python3ActionLoop/lib/launcher.py
./core/python3AiAction/pythonrunner.py
./core/python3AiAction/samples/smart-body-crop/common.py
./core/python3AiAction/samples/smart-body-crop/inference.py
./core/python3AiActionLoop/samples/smart-body-crop/common.py
./core/python3AiActionLoop/samples/smart-body-crop/inference.py
./core/python3AiActionLoop/lib/launcher.py
./tests/src/test/resources/python_virtualenv/__main__.py
./tests/src/test/resources/python_virtualenv_invalid_venv/__main__.py
./tests/src/test/resources/python_virtualenv_invalid_main/mymain.py
ac427 commented 4 years ago

@rabbah , most of the scripts use pip instead of pip3 and also the CMD in Dockerfiles use python instead of python3, that causes lot of issues. (example it can't find any of the python3 modules because of the wrong sys.path set by the script. )

I copied scripts from this repo and created a new docker image for my project. https://github.com/ac427/ibmfunction_bionic/blob/master/Dockerfile

I will try to create PR later this week in here.

dgrove-oss commented 3 years ago

closing as stale