Skip to content

Commit bc36981

Browse files
committed
[GR-45917] Documentation: Update GraalPy docs for JDK20.
PullRequest: graalpython/2789
2 parents c414421 + 88a3705 commit bc36981

File tree

12 files changed

+698
-634
lines changed

12 files changed

+698
-634
lines changed

README.md

Lines changed: 39 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,73 @@
11
# GraalVM Implementation of Python
22

3-
This is GraalPy, an implementation of the Python language.
4-
A primary goal is to support SciPy and its constituent libraries.
5-
GraalPy can usually execute pure Python code faster than CPython (but not when C extensions are involved).
6-
GraalPy currently aims to be compatible with Python 3.10, but it is some way from there.
7-
While your specific workload may function, any Python program that uses external packages could hit something unsupported.
3+
GraalPy is an implementation of the Python language on top of GraalVM.
4+
A primary goal is to support PyTorch, SciPy, and their constituent libraries, as well as to work with other data science and machine learning libraries from the rich Python ecosystem.
5+
GraalPy can usually execute pure Python code faster than CPython, and nearly match CPython performance when C extensions are involved.
6+
GraalPy currently aims to be compatible with Python 3.10.
7+
While many workloads run fine, any Python program that uses external packages could hit something unsupported.
88
At this point, the Python implementation is made available for experimentation and curious end-users.
9+
We welcome issue reports of all kinds and are working hard to close our compatibility gaps.
910

1011
### Trying It
1112

12-
The easiest option to try GraalPy is [Pyenv](https://github.com/pyenv/pyenv/), the Python version manager.
13+
The easiest option to try GraalPy is [pyenv](https://github.com/pyenv/pyenv/), the Python version manager.
1314
It allows you to easily install different GraalPy releases.
14-
To get version 22.3.0, for example, just run `pyenv install graalpy-22.3.0`.
15-
16-
To try GraalPy with a full GraalVM, including the support for Java embedding and interop with other languages, you can use the bundled releases from [www.graalvm.org](https://www.graalvm.org/downloads/).
15+
To install version 22.3.0, for example, just run `pyenv install graalpy-22.3.0`.
1716

1817
Another option is to use [Conda-Forge](https://conda-forge.org/).
19-
To get an environment with the latest GraalPy, use `conda create -c conda-forge -n graalpy graalpy`.
18+
To get an environment with the latest version of GraalPy, use the following command:
19+
20+
```bash
21+
conda create -c conda-forge -n graalpy graalpy
22+
```
23+
24+
To try GraalPy with a full GraalVM, including the support for Java embedding and interoperability with other languages, you can use the bundled releases from [www.graalvm.org](https://www.graalvm.org/downloads/).
25+
26+
>**Note:** There is currently no installer for Windows.
2027
2128
### Building from Source
2229

2330
#### Requirements
2431

25-
* [mx](https://github.com/graalvm/mx) - a separate Python tool co-developed for GraalVM development. This tool must be
26-
downloaded and put onto your PATH:
27-
```
32+
* [mx](https://github.com/graalvm/mx)
33+
34+
There is a separate Python tool for GraalVM development. This tool must be downloaded and added to your PATH:
35+
36+
```shell
2837
git clone https://github.com/graalvm/mx.git
2938
export PATH=$PWD/mx:$PATH
3039
```
3140
* LabsJDK
3241

33-
The following command will download and install JDKs to built GraalVM upon. If successful, it will print the path to set into your JAVA_HOME.
34-
```shell
35-
mx fetch-jdk
36-
```
42+
The following command will download and install JDKs upon which to build GraalVM. If successful, it will print the path for the value of your `JAVA_HOME` environment variable.
43+
```shell
44+
mx fetch-jdk
45+
```
3746

3847
#### Building
3948

40-
Run `mx --dy /compiler python-gvm` in the `graalpython` repository root. If the build is fine, it will print the full
41-
path to the `graalpy` executable as the last line of output.
42-
43-
For more information and some examples of what you can do with GraalPy,
44-
check out the [reference](https://www.graalvm.org/reference-manual/python/).
49+
Run `mx --dy /compiler python-gvm` in the root directory of the `graalpython` repository.
50+
If the build succeeds, it will print the full path to the `graalpy` executable as the last line of output.
51+
This builds a `bash` launcher that executes GraalPy on the JVM.
52+
To build a native launcher for lower footprint and better startup, run `mx python-svm` instead.
4553

46-
### Create a Virtual Environment
47-
48-
The best way of using the GraalVM implementation of Python is out of a virtual environment. To do so
49-
execute the following command in the project directory:
50-
```
51-
graalpy -m venv <dir-to-venv>
52-
```
53-
54-
To activate the environment in your shell session call:
55-
```
56-
source <dir-to-venv>/bin/activate
57-
```
58-
59-
In the venv, multiple executables are available, like `python`, `python3` and `graalpy`.
60-
61-
### Installing Packages
62-
63-
You should be able to use the `pip` command from a GraalPy venv to install packages.
64-
Our `pip` ships some patches for packages that we test internally, these will be applied automatically where necessary.
65-
Support for as many extension modules as possible is a high priority for us.
66-
We are actively building out our support for the Python C API to make extensions such as NumPy, SciPy, Scikit-learn, Pandas, Tensorflow and the like work fully.
67-
This means that some might already work, but we're still actively working on compatibility especially with native extensions.
54+
For more information and some examples of what you can do with GraalPy, see the [reference documentation](https://www.graalvm.org/reference-manual/python/).
6855

6956
### Polyglot Usage
7057

71-
We have a [document](docs/user/Interoperability.md) describing how we implement the
72-
cross-language interop. This will hopefully give you an idea how to use it.
58+
See the [documentation](docs/user/Interoperability.md) that describes how we implement
59+
cross-language interoperability.
60+
This should give you an idea about how to use it.
7361

7462
### Jython Support
7563

7664
We are working on a mode that is "mostly compatible" with some of Jython's
7765
features, minus of course that Jython implements Python 2.7 and we implement
78-
Python 3.10+. We describe the current status of the compatibility mode
79-
[here](docs/user/Jython.md).
66+
Python 3.10+.
67+
We describe the current status of the compatibility mode [here](docs/user/Jython.md).
68+
69+
We are working on a mode that is "mostly compatible" with some of Jython's features, considering the fact that Jython implements Python 2.7 and we implement Python 3.10+.
70+
For more details about compatibility, see [here](docs/user/Jython.md).
8071

8172
### Contributing
8273

0 commit comments

Comments
 (0)