Skip to content

Commit 9a99730

Browse files
ban-miolyagpl
authored andcommitted
Splitting GraalPy documentation for JVM and Python audiences
Co-authored-by: Betty Mann <betty.mann@oracle.com>
1 parent 33f5e2a commit 9a99730

24 files changed

Lines changed: 947 additions & 690 deletions

README.md

Lines changed: 12 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ GraalPy is ready for production running pure Python code and has experimental su
1616
**Low-overhead integration with Java and other languages**
1717

1818
* Use [Python in Java](docs/user/Interoperability.md) applications on GraalVM JDK, Oracle JDK, or OpenJDK
19-
* Use JVM tools like [Maven](docs/user/README.md), JFR, or [GraalVM Native Image](docs/user/Native-Images-with-Python.md)
19+
* Use JVM tools like [Maven](docs/user/Embedding-Build-Tools.md), JFR, or [GraalVM Native Image](docs/user/Native-Images-with-Python.md)
2020
* Manage Python libraries' system access thanks to GraalPy's [Java-based emulation of Python OS APIs](docs/user/Embedding-Permissions.md)
2121

2222
**Compatible with the Python ecosystem**
@@ -84,65 +84,13 @@ This means that build tools have to be available and installation will take long
8484
We provide [Github actions](scripts/wheelbuilder) to help you build binary packages with the correct dependencies.
8585
Thanks to our integration with GraalVM Native Image, we can deploy Python applications as [standalone binary](docs/user/Python-Standalone-Applications.md), all dependencies included.
8686

87-
* Linux
87+
**Quick Installation:**
8888

89-
The easiest way to install GraalPy on Linux is to use [Pyenv](https://github.com/pyenv/pyenv) (the Python version manager).
90-
To install version 25.0.2 using Pyenv, run the following commands:
91-
```bash
92-
pyenv install graalpy-25.0.2
93-
```
94-
```bash
95-
pyenv shell graalpy-25.0.2
96-
```
97-
> NOTE: There will be a delay between GraalPy release and its availability on Pyenv. Make sure to update Pyenv.
98-
99-
Alternatively, you can download a compressed GraalPy installation file from [GitHub releases](https://github.com/oracle/graalpython/releases).
100-
101-
1. Find the download that matches the pattern _graalpy-XX.Y.Z-linux-amd64.tar.gz_ or _graalpy-XX.Y.Z-linux-aarch64.tar.gz_ (depending on your platform) and download.
102-
2. Uncompress the file and update your `PATH` environment variable to include the _graalpy-XX.Y.Z-linux-amd64/bin_ (or _graalpy-XX.Y.Z-linux-aarch64/bin_) directory.
103-
104-
* macOS
105-
106-
The easiest way to install GraalPy on macOS is to use [Pyenv](https://github.com/pyenv/pyenv) (the Python version manager).
107-
To install version 25.0.2 using Pyenv, run the following commands:
108-
```bash
109-
pyenv install graalpy-25.0.2
110-
```
111-
```bash
112-
pyenv shell graalpy-25.0.2
113-
```
114-
> NOTE: There will be a delay between GraalPy release and its availability on Pyenv. Make sure to update Pyenv.
115-
116-
Alternatively, you can download a compressed GraalPy installation file from [GitHub releases](https://github.com/oracle/graalpython/releases).
117-
118-
1. Find the download that matches the pattern _graalpy-XX.Y.Z-macos-aarch64.tar.gz_ and download.
119-
2. Remove the quarantine attribute.
120-
```bash
121-
sudo xattr -r -d com.apple.quarantine /path/to/graalpy
122-
```
123-
For example:
124-
```bash
125-
sudo xattr -r -d com.apple.quarantine ~/.pyenv/versions/graalpy-25.0.2
126-
```
127-
3. Uncompress the file and update your `PATH` environment variable to include to the _graalpy-XX.Y.Z-macos-aarch64/bin_ directory.
128-
129-
* Windows
130-
131-
The Windows support of GraalPy is still experimental, so not all features and packages may be available.
132-
The easiest way to install GraalPy on Windows is to use [Pyenv-win](https://pyenv-win.github.io/pyenv-win/) (the Python version manager for Windows).
133-
To install version 25.0.2 using Pyenv-win, run the following commands:
134-
```cmd
135-
pyenv install graalpy-25.0.2-windows-amd64
136-
```
137-
```cmd
138-
pyenv shell graalpy-25.0.2-windows-amd64
139-
```
140-
> NOTE: There will be a delay between GraalPy release and its availability on Pyenv. Make sure to update Pyenv.
141-
142-
Alternatively, you can download a compressed GraalPy installation file from [GitHub releases](https://github.com/oracle/graalpython/releases).
89+
- **Linux/macOS**: `pyenv install graalpy-25.0.2 && pyenv shell graalpy-25.0.2`
90+
- **Windows**: `pyenv install graalpy-25.0.2-windows-amd64`
91+
- **Manual**: Download from [GitHub releases](https://github.com/oracle/graalpython/releases)
14392

144-
1. Find the download that matches the pattern _graalpy-XX.Y.Z-windows-amd64.tar.gz_ and download.
145-
2. Uncompress the file and update your `PATH` variable to include to the _graalpy-XX.Y.Z-windows-amd64/bin_ directory.
93+
**See the [complete installation guide](docs/user/Standalone-Getting-Started.md) for detailed instructions.**
14694

14795
</details>
14896
<details>
@@ -161,36 +109,17 @@ The _setup-python_ action supports GraalPy:
161109
<details>
162110
<summary><strong><a name="start-migrating-jython-scripts-to-graalpy"></a>Migrating Jython Scripts to GraalPy</strong></summary>
163111
164-
Most existing Jython code that uses Java integration will be based on a stable Jython release&mdash;however, these are only available in Python 2.x versions.
112+
Most existing Jython code that uses Java integration will be based on a stable Jython releasehowever, these are only available in Python 2.x versions.
165113
To migrate your code from Python 2 to Python 3, follow [the official guide from the Python community](https://docs.python.org/3/howto/pyporting.html).
166114
GraalPy provides a [special mode](docs/user/Python-on-JVM.md) to facilitate migration.
167-
To run Jython scripts, you need to use a GraalPy distribution running on the JVM so you can access Java classes from Python scripts.
168-
169-
* Linux
170-
171-
1. Find and download a compressed GraalPy installation file from [GitHub releases](https://github.com/oracle/graalpython/releases) that matches the pattern _graalpy-jvm-XX.Y.Z-linux-amd64.tar.gz_ or _graalpy-jvm-XX.Y.Z-linux-aarch64.tar.gz_ (depending on your platform) and download.
172-
2. Uncompress the file and update your `PATH` environment variable to include the _graalpy-jvm-XX.Y.Z-linux-amd64/bin_ (or _graalpy-jvm-XX.Y.Z-linux-aarch64/bin_) directory.
173-
3. Run your scripts with `graalpy --python.EmulateJython`.
174-
175-
* macOS
176115
177-
1. Find and download a compressed GraalPy installation file from [GitHub releases](https://github.com/oracle/graalpython/releases) that matches the pattern _graalpy-jvm-XX.Y.Z-macos-aarch64.tar.gz_ and download.
178-
2. Remove the quarantine attribute.
179-
```bash
180-
sudo xattr -r -d com.apple.quarantine /path/to/graalpy
181-
```
182-
For example:
183-
```bash
184-
sudo xattr -r -d com.apple.quarantine ~/.pyenv/versions/graalpy-25.0.2
185-
```
186-
3. Uncompress the file and update your `PATH` environment variable to include to the _graalpy-jvm-XX.Y.Z-macos-aarch64/bin_ directory.
187-
4. Run your scripts with `graalpy --python.EmulateJython`.
116+
**Quick Setup:**
188117
189-
* Windows
118+
1. Download a GraalPy JVM distribution: `graalpy-jvm-XX.Y.Z-<platform>.tar.gz`
119+
2. Extract and add to PATH
120+
3. Run with: `graalpy --python.EmulateJython`
190121

191-
1. Find and download a compressed GraalPy installation file from [GitHub releases](https://github.com/oracle/graalpython/releases) that matches the pattern _graalpy-jvm-XX.Y.Z-windows-amd64.tar.gz_.
192-
2. Uncompress the file and update your `PATH` variable to include to the _graalpy-jvm-XX.Y.Z-windows-amd64/bin_ directory.
193-
3. Run your scripts with `graalpy --python.EmulateJython`.
122+
**See the [complete migration guide](docs/user/Python-on-JVM.md) for detailed instructions.**
194123

195124
</details>
196125

docs/site/01-docs.md

Lines changed: 0 additions & 27 deletions
This file was deleted.

docs/site/01-python-developers.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
layout: docs
3+
title: Python Developers
4+
permalink: docs/python-developers/
5+
docs_index: python-developers
6+
nav_order: 1
7+
---
8+
9+
# GraalPy for Python Developers
10+
11+
**You want to use GraalPy instead of the standard Python from python.org.**
12+
13+
Install GraalPy on your machine and use it like any Python interpreter.
14+
You get better performance, the ability to compile to native binaries, and access to the GraalVM ecosystem.
15+
16+
{% gfm_docs ../user/Version-Compatibility.md %}
17+
18+
{% gfm_docs ../user/Platform-Support.md %}
19+
20+
These guides cover everything you need to know:
21+
22+
{% gfm_docs ../user/Standalone-Getting-Started.md %}
23+
{% gfm_docs ../user/Python-Runtime.md %}
24+
{% gfm_docs ../user/Python-Standalone-Applications.md %}
25+
{% gfm_docs ../user/Native-Extensions.md %}
26+
{% gfm_docs ../user/Performance.md %}
27+
{% gfm_docs ../user/Tooling.md %}
28+
29+
<h3 id="python-context-options">
30+
<a href="#python-context-options" class="anchor-link">Python Context Options</a>
31+
</h3>
32+
Below are the options you can set on contexts for GraalPy.
33+
{% python_options ../../graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/PythonOptions.java %}
34+
35+
{% gfm_docs ../user/Test-Tiers.md %}
36+
{% gfm_docs ../user/Troubleshooting.md %}
37+
38+
{% copy_assets ../user/assets %}

docs/site/02-downloads.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ You can extend it with Python code or leverage packages from the Python ecosyste
3333
Do you want to test your Python application or package on GraalPy?
3434
</h5>
3535
<h5 class="download-text">
36-
To test Python code on GraalPy, a standalone distribution is available for different platforms and in two different kinds: <a href="{{ '/docs/#graalpy-distributions' | relative_url }}">Native</a> (for compact download and footprint) and <a href="{{ '/docs/#graalpy-distributions' | relative_url }}">JVM</a> (for full Java interoperability). We recommend the distributions based on Oracle GraalVM for best performance and advanced features (released under the <a target="_blank" href="https://www.oracle.com/downloads/licenses/graal-free-license.html">GFTC license</a>). Distributions based on GraalVM Community Edition (released under the OSI-approved <a target="_blank" href="https://github.com/oracle/graalpython/blob/master/LICENSE.txt">UPL license</a>) are available on <a href="https://github.com/oracle/graalpython/releases" target="_blank">GitHub</a>. Standalone distributions are also available via <a target="_blank" href="{{ 'docs#installing-graalpy' | relative_url }}">pyenv</a>, <a target="_blank" href="{{ 'docs#installing-graalpy' | relative_url }}">pyenv-win</a>, and <a target="_blank" href="https://github.com/actions/setup-python?tab=readme-ov-file#basic-usage">setup-python</a>:
36+
To test Python code on GraalPy, a standalone distribution is available for different platforms and in two different kinds: <a href="{{ '/docs/python-developers/' | relative_url }}">Native</a> (for compact download and footprint) and <a href="{{ '/docs/python-developers/' | relative_url }}">JVM</a> (for full Java interoperability). We recommend the distributions based on Oracle GraalVM for best performance and advanced features (released under the <a target="_blank" href="https://www.oracle.com/downloads/licenses/graal-free-license.html">GFTC license</a>). Distributions based on GraalVM Community Edition (released under the OSI-approved <a target="_blank" href="https://github.com/oracle/graalpython/blob/master/LICENSE.txt">UPL license</a>) are available on <a href="https://github.com/oracle/graalpython/releases" target="_blank">GitHub</a>. Standalone distributions are also available via <a target="_blank" href="{{ 'docs/python-developers/' | relative_url }}">pyenv</a>, <a target="_blank" href="{{ 'docs/python-developers/' | relative_url }}">pyenv-win</a>, and <a target="_blank" href="https://github.com/actions/setup-python?tab=readme-ov-file#basic-usage">setup-python</a>:
3737
</h5>
3838
</div>
3939
<div class="languages__example-card">

docs/site/02-java-developers.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
layout: docs
3+
title: Java Developers
4+
permalink: docs/java-developers/
5+
docs_index: java-developers
6+
nav_order: 2
7+
---
8+
9+
# GraalPy for Java Developers
10+
11+
**For Java developers who need to use Python libraries from their Java applications or migrate from legacy Jython code.**
12+
13+
You do not need to install GraalPy separately - you can use GraalPy directly in Java with Maven or Gradle.
14+
This lets you call Python libraries like NumPy, pandas, or any PyPI package from your Java application.
15+
GraalPy also provides a migration path from Jython 2.x to Python 3.x with better performance and maintained Java integration capabilities.
16+
17+
{% gfm_docs ../user/Version-Compatibility.md %}
18+
19+
{% gfm_docs ../user/Platform-Support.md %}
20+
21+
These guides cover everything you need to know:
22+
23+
{% gfm_docs ../user/Embedding-Getting-Started.md %}
24+
{% gfm_docs ../user/Embedding-Build-Tools.md %}
25+
{% gfm_docs ../user/Embedding-Permissions.md %}
26+
{% gfm_docs ../user/Interoperability.md %}
27+
{% gfm_docs ../user/Native-Images-with-Python.md %}
28+
{% gfm_docs ../user/Python-on-JVM.md %}
29+
30+
<h3 id="python-context-options">
31+
<a href="#python-context-options" class="anchor-link">Python Context Options</a>
32+
</h3>
33+
Below are the options you can set on contexts for GraalPy.
34+
{% python_options ../../graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/PythonOptions.java %}
35+
36+
{% gfm_docs ../user/Test-Tiers.md %}
37+
{% gfm_docs ../user/Troubleshooting.md %}
38+
39+
{% copy_assets ../user/assets %}

docs/site/03-compatibility.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
layout: base
33
title: Compatibility
44
permalink: compatibility/
5+
nav_order: 3
56
---
67

78
<style>

docs/site/docs-redirect.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
layout: docs
3+
permalink: docs/
4+
redirect_to: docs/python-developers/
5+
---
6+
7+
<script>
8+
window.location.replace('/python/docs/python-developers/');
9+
</script>
10+
11+
<noscript>
12+
<meta http-equiv="refresh" content="0; url=/python/docs/python-developers/" />
13+
</noscript>
14+
15+
<p>Redirecting to <a href="/python/docs/python-developers/">Python Developers documentation</a>...</p>

0 commit comments

Comments
 (0)