Skip to content

Commit a111233

Browse files
committed
[GR-47923][GR-48496][GR-44824][GR-48447] Backports for Python.
PullRequest: graalpython/2959
2 parents e959b7d + 480855e commit a111233

File tree

79 files changed

+1223
-751
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+1223
-751
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ GRAALPYTHON_UNIT_TESTS.dist
2323
mx.graalpython/eclipse-launches
2424
*.json
2525
!**/resources/*.json
26+
!**/META-INF/**/*.json
2627
!graalpython/lib-graalpython/modules/standalone/shared/native-image-resources.json
2728
!graalpython/lib-graalpython/modules/standalone/shared/native-image-proxy-configuration.json
2829
language

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ This changelog summarizes major changes between GraalVM versions of the Python
44
language runtime. The main focus is on user-observable behavior of the engine.
55

66
## Version 23.1.0
7-
* Oracle GraalPy distributions (also known as GraalPy Enterprise) are now available under the [GFTC license](https://www.oracle.com/downloads/licenses/graal-free-license.html). The community builds published on Github have been renamed to `graalpy-community-<version>-<os>-<arch>.tar.gz`.
7+
* Oracle GraalPy distributions (previously known as GraalPy Enterprise) are now available under the [GFTC license](https://www.oracle.com/downloads/licenses/graal-free-license.html). The community builds published on Github have been renamed to `graalpy-community-<version>-<os>-<arch>.tar.gz`.
88
* Add support for the sqlite3 module. This allows many packages like `coverage` or `Flask-SQLAlchemy` to work on top of this embedded database.
9-
* Provide Windows distributions of GraalPy. This is the first preview of Windows support for this feature, and there are limitations, but pure Python packages like Pygal can be installed with `python -m pip --no-cache install pygal`.
9+
* Provide Windows distributions of GraalPy. This is the first preview of Windows support for GraalPy, and there are limitations, but pure Python packages like Pygal can be installed with `python -m pip --no-cache install pygal`.
1010
* The GraalPy standalone tool was updated. You can now build single-file executable Python binaries for Linux, Windows, and macOS. The tool can also generate a skeleton Maven project that sets up a polyglot embedding of Python packages into Java.
1111

1212
## Version 23.0.0

ci.jsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "overlay": "307e5a817ece2f16b7500db068a58c0538cf2101" }
1+
{ "overlay": "61d2e798a75f4b48457dda2d3b1d3f2ec83dace7" }

docs/user/PythonStandaloneBinaries.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,43 +9,41 @@ 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

21-
## Creating GraalPy Binaries
21+
## Creating GraalPy Native Binaries
2222

2323
Suppose there is a simple Python script, _my_script.py_, that does some useful work when run directly.
2424
To distribute it as a standalone native binary, run the following command:
2525

2626
```bash
27-
graalpy -m standalone binary \
27+
graalpy -m standalone native \
2828
--module my_script.py \
2929
--output my_binary
3030
```
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.
33-
Use `graalpy -m standalone binary --help` for further options.
34-
33+
Use `graalpy -m standalone native --help` for further options.
34+
3535
## Embedding GraalPy in a Java Application
3636

37-
You can distribute the Python script as a JAR file that runs on GraalVM and includes GraalPy.
38-
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:
3939

4040
```bash
41-
graalpy -m standalone java \
42-
--module my_script.py \
43-
--output-directory MyJavaApplication
41+
graalpy -m standalone polyglot_app --output-directory MyJavaApplication
4442
```
4543

46-
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.
4745
You can open this Maven project with any Java IDE and edit the main class that was created to modify the Python embedding.
48-
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.
4947

5048
Take a look at the generated _pom.xml_ file.
5149
There are some options to tweak the performance and footprint trade-off.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -39,7 +39,7 @@
3939
* SOFTWARE.
4040
*/
4141

42-
package com.oracle.graal.python.pegparser;
42+
package com.oracle.graal.python.pegparser.test;
4343

4444
import org.junit.Test;
4545

graalpython/com.oracle.graal.python.pegparser.test/src/com/oracle/graal/python/pegparser/AtomsTests.java renamed to graalpython/com.oracle.graal.python.pegparser.test/src/com/oracle/graal/python/pegparser/test/AtomsTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -38,7 +38,7 @@
3838
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3939
* SOFTWARE.
4040
*/
41-
package com.oracle.graal.python.pegparser;
41+
package com.oracle.graal.python.pegparser.test;
4242

4343
import org.junit.Test;
4444

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -39,7 +39,7 @@
3939
* SOFTWARE.
4040
*/
4141

42-
package com.oracle.graal.python.pegparser;
42+
package com.oracle.graal.python.pegparser.test;
4343

4444
import org.junit.Test;
4545

graalpython/com.oracle.graal.python.pegparser.test/src/com/oracle/graal/python/pegparser/BasicTests.java renamed to graalpython/com.oracle.graal.python.pegparser.test/src/com/oracle/graal/python/pegparser/test/BasicTests.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -38,10 +38,11 @@
3838
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3939
* SOFTWARE.
4040
*/
41-
package com.oracle.graal.python.pegparser;
41+
package com.oracle.graal.python.pegparser.test;
4242

4343
import java.io.File;
4444

45+
import com.oracle.graal.python.pegparser.InputType;
4546
import org.junit.Test;
4647

4748
public class BasicTests extends ParserTestBase {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -39,7 +39,7 @@
3939
* SOFTWARE.
4040
*/
4141

42-
package com.oracle.graal.python.pegparser;
42+
package com.oracle.graal.python.pegparser.test;
4343

4444
import org.junit.Test;
4545

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -39,8 +39,9 @@
3939
* SOFTWARE.
4040
*/
4141

42-
package com.oracle.graal.python.pegparser;
42+
package com.oracle.graal.python.pegparser.test;
4343

44+
import com.oracle.graal.python.pegparser.InputType;
4445
import org.junit.Test;
4546

4647
public class ClassDefTests extends ParserTestBase {
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -38,7 +38,9 @@
3838
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3939
* SOFTWARE.
4040
*/
41-
package com.oracle.graal.python.pegparser;
41+
package com.oracle.graal.python.pegparser.test;
42+
43+
import com.oracle.graal.python.pegparser.PythonStringFactory;
4244

4345
public class DefaultStringFactoryImpl implements PythonStringFactory<String> {
4446
@Override
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -39,7 +39,7 @@
3939
* SOFTWARE.
4040
*/
4141

42-
package com.oracle.graal.python.pegparser;
42+
package com.oracle.graal.python.pegparser.test;
4343

4444
import org.junit.Test;
4545

graalpython/com.oracle.graal.python.pegparser.test/src/com/oracle/graal/python/pegparser/ErrorTests.java renamed to graalpython/com.oracle.graal.python.pegparser.test/src/com/oracle/graal/python/pegparser/test/ErrorTests.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -38,10 +38,12 @@
3838
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3939
* SOFTWARE.
4040
*/
41-
package com.oracle.graal.python.pegparser;
41+
package com.oracle.graal.python.pegparser.test;
4242

4343
import java.util.EnumSet;
4444

45+
import com.oracle.graal.python.pegparser.FutureFeature;
46+
import com.oracle.graal.python.pegparser.InputType;
4547
import org.junit.Test;
4648

4749
/**
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -39,7 +39,7 @@
3939
* SOFTWARE.
4040
*/
4141

42-
package com.oracle.graal.python.pegparser;
42+
package com.oracle.graal.python.pegparser.test;
4343

4444
import java.io.File;
4545

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -38,7 +38,7 @@
3838
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3939
* SOFTWARE.
4040
*/
41-
package com.oracle.graal.python.pegparser;
41+
package com.oracle.graal.python.pegparser.test;
4242

4343
import org.junit.Test;
4444

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -39,7 +39,7 @@
3939
* SOFTWARE.
4040
*/
4141

42-
package com.oracle.graal.python.pegparser;
42+
package com.oracle.graal.python.pegparser.test;
4343

4444
import org.junit.Test;
4545

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -39,7 +39,7 @@
3939
* SOFTWARE.
4040
*/
4141

42-
package com.oracle.graal.python.pegparser;
42+
package com.oracle.graal.python.pegparser.test;
4343

4444
import org.junit.Test;
4545

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -39,7 +39,7 @@
3939
* SOFTWARE.
4040
*/
4141

42-
package com.oracle.graal.python.pegparser;
42+
package com.oracle.graal.python.pegparser.test;
4343

4444
import org.junit.Test;
4545

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -38,7 +38,7 @@
3838
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3939
* SOFTWARE.
4040
*/
41-
package com.oracle.graal.python.pegparser;
41+
package com.oracle.graal.python.pegparser.test;
4242

4343
import org.junit.Test;
4444

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -38,7 +38,7 @@
3838
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3939
* SOFTWARE.
4040
*/
41-
package com.oracle.graal.python.pegparser;
41+
package com.oracle.graal.python.pegparser.test;
4242

4343
import org.junit.Test;
4444

0 commit comments

Comments
 (0)