Skip to content

Commit 2cfd11e

Browse files
author
Franziska Geiger
committed
Added documentation for venv, debugging and IDE init
PullRequest: graalpython/588
2 parents 45c864e + fbc4a78 commit 2cfd11e

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,24 @@ To try it, you can use the bundled releases from
1414
some examples of what you can do with it, check out the
1515
[reference](https://www.graalvm.org/docs/reference-manual/languages/python/).
1616

17+
### Create a virtual environment
18+
19+
The best way of using the GraalVM implementation of Python is out of a virtual environment. This generates
20+
wrapper scripts and makes the implementation usable from shell as standard Python interpreter. To do so
21+
execute the following command in the project directory:
22+
23+
```
24+
mx graalpython -m venv <dir-to-venv>
25+
```
26+
27+
To activate the environment in your shell session call:
28+
29+
```
30+
source <dir-to-venv>/bin/activate
31+
```
32+
33+
In the venv multiple executables are available, like `python`, `python3` and `graalpython`.
34+
1735
### Installing packages
1836

1937
At the moment not enough of the standard library is implemented to run the

doc/CONTRIBUTING.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,22 @@ The C implementation and headers for our C API are in
7979
`graalpython/com.oracle.graal.python.cext`. The naming is analogous to C
8080
Python's source names. This folder also includes a `modules` folder for built-in
8181
modules that we have adapted from C Python.
82+
83+
##### Debug options
84+
85+
The GraalVM implementation of Python provides proper debug options. It is possible to either debug the Python code, using Chrome debugger,
86+
or the java code, using your preferred IDE.
87+
The following commands should be executed in a virtualenv environment, which provides a graalpython executable.
88+
89+
For debug Python side code call this:
90+
91+
```graalpython --inspect your_script.py ```
92+
93+
This will open a debug server, which can be accessed in Chrome Browser under URL `chrome://inspect`.
94+
95+
For debugging java implemented code execute:
96+
97+
```graalpython --experimental-options -debug-java your_script.py```
98+
99+
The command will also start a debug server, which can be used in an IDE. If the IDE was initialized properly
100+
by using the command mentioned above, the existing `GraalDebug` run configuration can be used to debug.

0 commit comments

Comments
 (0)