grumpyhome / grumpy

Grumpy is a Python to Go source code transcompiler and runtime.
Apache License 2.0
420 stars 18 forks source link

Support installing grumpy-runtime in editable mode #152

Open abitrolly opened 4 years ago

abitrolly commented 4 years ago

pip install --editable . allow to edit source code of Python package and run it without rebuilding the package. grumpy-runtime doesn't support this, and it also takes a long time to rebuild itself.

When runtime is installed in editable mode, the grumpy run command fails with this.

# grumpy -c 'print("hello")'
/tmp/tmptxtN5t__pycache__/gopath/src/__python__/main.go:6:2: cannot find package "__python__/__go__/grumpy" in any of:
    /usr/lib/go-1.13/src/__python__/__go__/grumpy (from $GOROOT)
    /tmp/tmptxtN5t__pycache__/gopath/src/__python__/__go__/grumpy (from $GOPATH)
    /app/grumpy-runtime-src/grumpy_runtime/data/gopath/src/__python__/__go__/grumpy

From https://github.com/grumpyhome/grumpy/pull/151#issuecomment-644637957