Skip to content

Commit bd290f2

Browse files
tomasstupkatimfel
authored andcommitted
adjusted PythonStandaloneBinaries.md to current state of standalone module
(cherry picked from commit 224cea5)
1 parent 53dee55 commit bd290f2

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

docs/user/PythonStandaloneBinaries.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ permalink: /reference-manual/python/standalone-binaries/
99
With GraalPy, you can distribute Python applications or libraries as standalone binaries or JAR files without any external dependencies.
1010
The [Truffle framework](https://github.com/oracle/graal/tree/master/truffle) on which GraalPy is built, and the [Sulong LLVM runtime](https://github.com/oracle/graal/tree/master/sulong) that GraalPy leverages for managed execution of Python's native extensions enables users to completely virtualize all filesystem accesses of Python programs, including those to the standard library and installed packages.
1111

12-
GraalPy comes with a module that can create standalone binaries or Java project skeletons.
12+
GraalPy comes with a module that can create standalone binaries or Java-Python polyglot project skeletons.
1313
The binaries bundle everything into one native executable.
14-
The Java skeletons are set up with Maven to build and run self-contained JAR files.
15-
They can also be used to generate a standalone binary from those JAR files later, so Java skeletons offer more flexibility and control over the steps.
14+
The polyglot skeletons are set up with Maven to to generate a standalone binary for a simple java - python hello world example and can be used as a starting point or inspiration for further java-python polyglot development.
1615

1716
### Prerequisite
1817

19-
Set `JAVA_HOME` to use a GraalVM distribution.
18+
A GraalPy distribution.
19+
TODO - add link
2020

2121
## Creating GraalPy Native Binaries
2222

@@ -31,23 +31,19 @@ graalpy -m standalone native \
3131

3232
It generates a standalone _my_binary_ file which includes the Python code, the GraalPy runtime, and the Python standard library in a single, self-contained executable.
3333
Use `graalpy -m standalone native --help` for further options.
34-
35-
XXX add polyglot app if implemented
3634

3735
## Embedding GraalPy in a Java Application
3836

39-
You can distribute the Python script as a JAR file that runs on GraalVM and includes GraalPy.
40-
To achieve this, run the `java` subcommand of GraalPy's `standalone` module:
37+
You can also generate a Java-Python polyglot project skeleton.
38+
To achieve this, run the `polyglot_app` subcommand of GraalPy's `standalone` module:
4139

4240
```bash
43-
graalpy -m standalone java \
44-
--module my_script.py \
45-
--output-directory MyJavaApplication
41+
graalpy -m standalone polyglot_app --output-directory MyJavaApplication
4642
```
4743

48-
It creates a Java project _MyJavaApplication_. It includes a _pom.xml_ file that makes it easy to generate a JAR file or a GraalVM native executable with Maven.
44+
It creates a Java project _MyJavaApplication_. It includes a _pom.xml_ file that makes it easy to generate a GraalVM native executable with Maven.
4945
You can open this Maven project with any Java IDE and edit the main class that was created to modify the Python embedding.
50-
To build the application, either use `mvn -Pjar package` to create a JAR file, or `mvn -Pnative package` to create a GraalVM native executable.
46+
To build the application, either use `mvn -Pnative package` to create a GraalVM native executable.
5147

5248
Take a look at the generated _pom.xml_ file.
5349
There are some options to tweak the performance and footprint trade-off.

0 commit comments

Comments
 (0)