oracle / graalpython

GraalPy – A high-performance embeddable Python 3 runtime for Java
https://www.graalvm.org/python/
Other
1.25k stars 111 forks source link

Python IDEs and Tools Compatibility #284

Open fniephaus opened 2 years ago

fniephaus commented 2 years ago

TL;DR

We plan to gradually improve support for popular Python IDEs and tools in GraalPy.

Goals

In addition to compatibility with popular Python packages (https://github.com/oracle/graalpython/issues/283), we also focus on compatibility with tools such as pdb and pyenv as well as with IDEs for Python such as VS Code or PyCharm. This should make it easier for Python developers to switch to GraalPy as their Python interpreter using their preferred set of tools.

Non-Goals

ahmednrana commented 4 months ago

Is there any update on this. Does pycharm / vscode work with Graalpy.

timfel commented 4 months ago

Is there any update on this. Does pycharm / vscode work with Graalpy.

* Does it provides autocompletion for Java in python?

No, this would need special extensions for these IDEs that go beyond supporting the existing Python tools, libraries, and IDEs. It's not that we won't do it, but it's not part of this ticket.

* Can we debug it using these tools?

Debugging with PyCharm works, VSCode unfortunately uses a fork call that cannot be supported on GraalPy and we have to work with the VSCode developers to add support for GraalPy.

msimacek commented 4 months ago

I think the question about debugging was also about Java code. It's not possible to debug both Java and Python with a single debugger. But it's possible to attach a Java debugger (from a Java IDE like IntelliJ IDEA) to the python process and then debug the Java parts separately. To do that you need to add --vm.Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend=y argument to the python invocation and configure remote debugging in the Java IDE to connect locally to port 8000. You can have both a Python debugger and a Java debugger attached to the same process.

ciscorucinski commented 1 month ago

uv is gaining a lot of support

timfel commented 1 month ago

uv is gaining a lot of support

uv supports GraalPy already 🙂 https://github.com/astral-sh/uv/pull/5141

meoyawn commented 5 days ago

uv is gaining a lot of support

uv supports GraalPy already 🙂 astral-sh/uv#5141

are there any examples of hooking up gradle + graalpy + uv? Specifically about adding pypi packages https://www.graalvm.org/latest/reference-manual/python/:

image
timfel commented 5 days ago

@meoyawn you mind describing (ideally in a separate issue) what you think you would gain from uv in this context? How the Gradle and Maven plugins install packages is an implementation detail at this point. I'm not sure what difference it makes how the packages are installed since from the developer UX it should appear as part of the Gradle or Maven are lifecycle phases