Skip to content

Commit 4fabb82

Browse files
committed
[GR-71393] Default to GraalPyResource.contextBuilder, change to 25.0.2 and remove macOS x64
1 parent d20102a commit 4fabb82

11 files changed

Lines changed: 27 additions & 81 deletions

File tree

.github/scripts/extract_matrix.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@
7777

7878
# Gitlab Runners OSS
7979
OSS = {
80-
"macos-latest": ["darwin", "aarch64"],
8180
"ubuntu-latest": ["linux", "amd64"],
8281
"ubuntu-24.04-arm": ["linux", "aarch64"],
8382
"windows-latest": ["windows", "amd64"]

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Refer to our [embedding documentation](https://www.graalvm.org/latest/reference-
6969
* Gradle
7070
```kotlin
7171
implementation("org.graalvm.polyglot:polyglot:25.0.2")
72-
implementation("org.graalvm.polyglot:python:25.0.2")
72+
implementation("org.graalvm.python:python-embedding:25.0.2")
7373
```
7474

7575
</details>
@@ -115,7 +115,7 @@ Thanks to our integration with GraalVM Native Image, we can deploy Python applic
115115
116116
Alternatively, you can download a compressed GraalPy installation file from [GitHub releases](https://github.com/oracle/graalpython/releases).
117117

118-
1. Find the download that matches the pattern _graalpy-XX.Y.Z-macos-amd64.tar.gz_ or _graalpy-XX.Y.Z-macos-aarch64.tar.gz_ (depending on your platform) and download.
118+
1. Find the download that matches the pattern _graalpy-XX.Y.Z-macos-aarch64.tar.gz_ and download.
119119
2. Remove the quarantine attribute.
120120
```bash
121121
sudo xattr -r -d com.apple.quarantine /path/to/graalpy
@@ -124,7 +124,7 @@ Thanks to our integration with GraalVM Native Image, we can deploy Python applic
124124
```bash
125125
sudo xattr -r -d com.apple.quarantine ~/.pyenv/versions/graalpy-25.0.2
126126
```
127-
3. Uncompress the file and update your `PATH` environment variable to include to the _graalpy-XX.Y.Z-macos-amd64/bin_ (or _graalpy-XX.Y.Z-macos-aarch64/bin_) directory.
127+
3. Uncompress the file and update your `PATH` environment variable to include to the _graalpy-XX.Y.Z-macos-aarch64/bin_ directory.
128128

129129
* Windows
130130

@@ -174,7 +174,7 @@ To run Jython scripts, you need to use a GraalPy distribution running on the JVM
174174

175175
* macOS
176176

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-amd64.tar.gz_ or _graalpy-jvm-XX.Y.Z-macos-aarch64.tar.gz_ (depending on your platform) and download.
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.
178178
2. Remove the quarantine attribute.
179179
```bash
180180
sudo xattr -r -d com.apple.quarantine /path/to/graalpy
@@ -183,7 +183,7 @@ To run Jython scripts, you need to use a GraalPy distribution running on the JVM
183183
```bash
184184
sudo xattr -r -d com.apple.quarantine ~/.pyenv/versions/graalpy-25.0.2
185185
```
186-
3. Uncompress the file and update your `PATH` environment variable to include to the _graalpy-jvm-XX.Y.Z-macos-amd64/bin_ (or _graalpy-jvm-XX.Y.Z-macos-aarch64/bin_) directory.
186+
3. Uncompress the file and update your `PATH` environment variable to include to the _graalpy-jvm-XX.Y.Z-macos-aarch64/bin_ directory.
187187
4. Run your scripts with `graalpy --python.EmulateJython`.
188188

189189
* Windows
@@ -222,7 +222,7 @@ Consult the [security guide](./SECURITY.md) for our responsible security vulnera
222222
223223
## License
224224
225-
This GraalVM implementation of Python is Copyright (c) 2017, 2024 Oracle and/or its affiliates and is made available to you under the terms the Universal Permissive License v 1.0 as shown at [https://oss.oracle.com/licenses/upl/](https://oss.oracle.com/licenses/upl/).
225+
This GraalVM implementation of Python is Copyright (c) 2017, 2026 Oracle and/or its affiliates and is made available to you under the terms the Universal Permissive License v 1.0 as shown at [https://oss.oracle.com/licenses/upl/](https://oss.oracle.com/licenses/upl/).
226226
This implementation is in part derived from and contains additional code from 3rd parties, the copyrights and licensing of which is detailed in the [LICENSE](./LICENSE.txt) and [THIRD_PARTY_LICENSE](THIRD_PARTY_LICENSE.txt) files.
227227
228228
[badge-slack]: https://img.shields.io/badge/Slack-join-active?logo=slack

docs/site/02-downloads.md

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ steps:
8484
<th>Linux (aarch64)</th>
8585
<th>Linux (amd64)</th>
8686
<th>macOS (aarch64)</th>
87-
<th>macOS (amd64)</th>
8887
<th class="border-correct-4">Windows (amd64)</th>
8988
</tr>
9089
<tr>
@@ -133,20 +132,6 @@ steps:
133132
<rect width="24" height="24" fill="white"/>
134133
</clipPath>
135134
</defs>
136-
</svg>
137-
</a></td>
138-
<td><a target="_blank" href="https://github.com/oracle/graalpython/releases/download/graal-{{ site.language_version }}/graalpy-{{ site.language_version }}-macos-amd64.tar.gz">
139-
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
140-
<g clip-path="url(#clip0_261_486)">
141-
<path d="M12 0C5.383 0 0 5.383 0 12C0 18.617 5.383 24 12 24C18.617 24 24 18.617 24 12C24 5.383 18.617 0 12 0Z" fill="#F29111"/>
142-
<path d="M7 19H17C17.553 19 18 18.552 18 18C18 17.448 17.553 17 17 17H7C6.447 17 6 17.448 6 18C6 18.552 6.447 19 7 19Z" fill="#09222E"/>
143-
<path d="M11.4693 14.78C11.6153 14.927 11.8073 15 11.9993 15C12.1913 15 12.3833 14.927 12.5293 14.78L15.7793 11.53C16.2513 11.06 15.9183 10.25 15.2493 10.25H12.9993V5.75C12.9993 5.198 12.5523 4.75 11.9993 4.75C11.4463 4.75 10.9993 5.198 10.9993 5.75V10.25H8.74927C8.08027 10.25 7.74727 11.06 8.21927 11.53L11.4693 14.78Z" fill="#09222E"/>
144-
</g>
145-
<defs>
146-
<clipPath id="clip0_261_486">
147-
<rect width="24" height="24" fill="white"/>
148-
</clipPath>
149-
</defs>
150135
</svg>
151136
</a></td>
152137
<td><a target="_blank" href="https://github.com/oracle/graalpython/releases/download/graal-{{ site.language_version }}/graalpy-{{ site.language_version }}-windows-amd64.tar.gz"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -205,20 +190,6 @@ steps:
205190
<rect width="24" height="24" fill="white"/>
206191
</clipPath>
207192
</defs>
208-
</svg>
209-
</a></td>
210-
<td><a target="_blank" href="https://github.com/oracle/graalpython/releases/download/graal-{{ site.language_version }}/graalpy-jvm-{{ site.language_version }}-macos-amd64.tar.gz">
211-
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
212-
<g clip-path="url(#clip0_261_486)">
213-
<path d="M12 0C5.383 0 0 5.383 0 12C0 18.617 5.383 24 12 24C18.617 24 24 18.617 24 12C24 5.383 18.617 0 12 0Z" fill="#F29111"/>
214-
<path d="M7 19H17C17.553 19 18 18.552 18 18C18 17.448 17.553 17 17 17H7C6.447 17 6 17.448 6 18C6 18.552 6.447 19 7 19Z" fill="#09222E"/>
215-
<path d="M11.4693 14.78C11.6153 14.927 11.8073 15 11.9993 15C12.1913 15 12.3833 14.927 12.5293 14.78L15.7793 11.53C16.2513 11.06 15.9183 10.25 15.2493 10.25H12.9993V5.75C12.9993 5.198 12.5523 4.75 11.9993 4.75C11.4463 4.75 10.9993 5.198 10.9993 5.75V10.25H8.74927C8.08027 10.25 7.74727 11.06 8.21927 11.53L11.4693 14.78Z" fill="#09222E"/>
216-
</g>
217-
<defs>
218-
<clipPath id="clip0_261_486">
219-
<rect width="24" height="24" fill="white"/>
220-
</clipPath>
221-
</defs>
222193
</svg>
223194
</a></td>
224195
<td><a target="_blank" href="https://github.com/oracle/graalpython/releases/download/graal-{{ site.language_version }}/graalpy-jvm-{{ site.language_version }}-windows-amd64.tar.gz">
@@ -279,20 +250,6 @@ steps:
279250
<rect width="24" height="24" fill="white"/>
280251
</clipPath>
281252
</defs>
282-
</svg>
283-
</a></td>
284-
<td><a target="_blank" href="https://raw.githubusercontent.com/graalvm/graal-languages-ea-builds/refs/heads/main/graalpy/versions/latest-native-macos-amd64.url">
285-
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
286-
<g clip-path="url(#clip0_261_486)">
287-
<path d="M12 0C5.383 0 0 5.383 0 12C0 18.617 5.383 24 12 24C18.617 24 24 18.617 24 12C24 5.383 18.617 0 12 0Z" fill="#F29111"/>
288-
<path d="M7 19H17C17.553 19 18 18.552 18 18C18 17.448 17.553 17 17 17H7C6.447 17 6 17.448 6 18C6 18.552 6.447 19 7 19Z" fill="#09222E"/>
289-
<path d="M11.4693 14.78C11.6153 14.927 11.8073 15 11.9993 15C12.1913 15 12.3833 14.927 12.5293 14.78L15.7793 11.53C16.2513 11.06 15.9183 10.25 15.2493 10.25H12.9993V5.75C12.9993 5.198 12.5523 4.75 11.9993 4.75C11.4463 4.75 10.9993 5.198 10.9993 5.75V10.25H8.74927C8.08027 10.25 7.74727 11.06 8.21927 11.53L11.4693 14.78Z" fill="#09222E"/>
290-
</g>
291-
<defs>
292-
<clipPath id="clip0_261_486">
293-
<rect width="24" height="24" fill="white"/>
294-
</clipPath>
295-
</defs>
296253
</svg>
297254
</a></td>
298255
<td><a target="_blank" href="https://raw.githubusercontent.com/graalvm/graal-languages-ea-builds/refs/heads/main/graalpy/versions/latest-native-windows-amd64.url">
@@ -352,20 +309,6 @@ steps:
352309
<rect width="24" height="24" fill="white"/>
353310
</clipPath>
354311
</defs>
355-
</svg>
356-
</a></td>
357-
<td><a target="_blank" href="https://raw.githubusercontent.com/graalvm/graal-languages-ea-builds/refs/heads/main/graalpy/versions/latest-jvm-macos-amd64.url">
358-
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
359-
<g clip-path="url(#clip0_261_486)">
360-
<path d="M12 0C5.383 0 0 5.383 0 12C0 18.617 5.383 24 12 24C18.617 24 24 18.617 24 12C24 5.383 18.617 0 12 0Z" fill="#F29111"/>
361-
<path d="M7 19H17C17.553 19 18 18.552 18 18C18 17.448 17.553 17 17 17H7C6.447 17 6 17.448 6 18C6 18.552 6.447 19 7 19Z" fill="#09222E"/>
362-
<path d="M11.4693 14.78C11.6153 14.927 11.8073 15 11.9993 15C12.1913 15 12.3833 14.927 12.5293 14.78L15.7793 11.53C16.2513 11.06 15.9183 10.25 15.2493 10.25H12.9993V5.75C12.9993 5.198 12.5523 4.75 11.9993 4.75C11.4463 4.75 10.9993 5.198 10.9993 5.75V10.25H8.74927C8.08027 10.25 7.74727 11.06 8.21927 11.53L11.4693 14.78Z" fill="#09222E"/>
363-
</g>
364-
<defs>
365-
<clipPath id="clip0_261_486">
366-
<rect width="24" height="24" fill="white"/>
367-
</clipPath>
368-
</defs>
369312
</svg>
370313
</a></td>
371314
<td class="border-correct-2"><a target="_blank" href="https://raw.githubusercontent.com/graalvm/graal-languages-ea-builds/refs/heads/main/graalpy/versions/latest-jvm-windows-amd64.url">

docs/site/_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
baseurl: "/python"
22
url: "https://graalvm.org"
33
github: "oracle/graalpython"
4-
language_version: 25.0.1
4+
language_version: 25.0.2
55
name: GraalPy
66

77
permalink: pretty

docs/site/index.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ layout: base
146146
</div>
147147
{%- highlight groovy -%}
148148
implementation("org.graalvm.polyglot:polyglot:{{ site.language_version }}")
149-
implementation("org.graalvm.polyglot:python:{{ site.language_version }}")
149+
implementation("org.graalvm.python:python-embedding:{{ site.language_version }}")
150150
{%- endhighlight -%}
151151
</div>
152152
<div class="example-logo-box">
@@ -163,8 +163,9 @@ implementation("org.graalvm.polyglot:python:{{ site.language_version }}")
163163
</div>
164164
{%- highlight java -%}
165165
import org.graalvm.polyglot.Context;
166+
import org.graalvm.python.embedding.GraalPyResources;
166167

167-
try (Context context = Context.create()) {
168+
try (Context context = GraalPyResources.contextBuilder().build()) {
168169
context.eval("python", "print('Hello from GraalPy!')");
169170
}
170171
{%- endhighlight -%}

docs/user/Interoperability.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,11 @@ This allows other languages to call your Python code directly.
252252
Then use it, for example, from Java code:
253253
```java
254254
import org.graalvm.polyglot.*;
255-
255+
import org.graalvm.python.embedding.GraalPyResources;
256+
256257
class Main {
257258
public static void main(String[] args) {
258-
try (var context = Context.create()) {
259+
try (var context = GraalPyResources.createContext()) {
259260
context.eval(Source.newBuilder("python", "file:///python_script.py").build());
260261

261262
String result = context.
@@ -399,10 +400,11 @@ import java.nio.file.Files;
399400
import java.nio.file.Path;
400401

401402
import org.graalvm.polyglot.Context;
403+
import org.graalvm.python.embedding.GraalPyResources;
402404

403405
class Main {
404406
public static void main(String[] args) {
405-
try (var context = Context.create()) {
407+
try (var context = GraalPyResources.createContext()) {
406408
context.eval("python", Files.readString(Path.of("path/to/interop/behavior/script.py")));
407409
assert context.eval("python", "numpy.float64(12)").asDouble() == 12.0;
408410
assert context.eval("python", "numpy.int32(12)").asByte() == 12;
@@ -446,12 +448,13 @@ The following snippet sets up the Java environment and makes the object availabl
446448

447449
```java
448450
import org.example.MyJavaClass;
451+
import org.graalvm.python.embedding.GraalPyResources;
449452

450453
class Main {
451454

452455
public static void main(String[] args) {
453456
MyJavaClass myJavaObject = new MyJavaClass(42, 17);
454-
try (var context = Context.create()) {
457+
try (var context = GraalPyResources.createContext()) {
455458
// myJavaObject will be globally available in example.py as my_java_object
456459
context.getBindings("python").putMember("my_java_object", myJavaObject);
457460
context.eval(Source.newBuilder("python", "example.py"));

docs/user/Python-Runtime.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ pyenv shell graalpy-25.0.2
9797
9898
Alternatively, you can download a compressed GraalPy installation file from [GitHub releases](https://github.com/oracle/graalpython/releases).
9999

100-
1. Find the download that matches the pattern _graalpy-XX.Y.Z-macos-amd64.tar.gz_ or _graalpy-XX.Y.Z-macos-aarch64.tar.gz_ (depending on your platform) and download.
100+
1. Find the download that matches the pattern _graalpy-XX.Y.Z-macos-aarch64.tar.gz_ and download.
101101
2. Remove the quarantine attribute.
102102
```bash
103103
sudo xattr -r -d com.apple.quarantine /path/to/graalpy
@@ -106,7 +106,7 @@ Alternatively, you can download a compressed GraalPy installation file from [Git
106106
```bash
107107
sudo xattr -r -d com.apple.quarantine ~/.pyenv/versions/graalpy-25.0.2
108108
```
109-
3. Uncompress the file and update your `PATH` environment variable to include to the _graalpy-XX.Y.Z-macos-amd64/bin_ (or _graalpy-XX.Y.Z-macos-aarch64/bin_) directory.
109+
3. Uncompress the file and update your `PATH` environment variable to include to the _graalpy-XX.Y.Z-macos-aarch64/bin_ directory.
110110

111111
### Windows
112112

docs/user/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,18 +97,19 @@ In order to distribute the resulting application for other systems, follow these
9797
- Include the GraalPy support and the [GraalVM Polyglot API](https://www.graalvm.org/sdk/javadoc/org/graalvm/polyglot/package-summary.html) in the `dependencies` section:
9898
```bash
9999
implementation("org.graalvm.polyglot:polyglot:25.0.2")
100-
implementation("org.graalvm.polyglot:python:25.0.2")
100+
implementation("org.graalvm.python:python-embedding:25.0.2")
101101
```
102102

103103
3. Finally, replace the code in the file named _App.java_ as follows for a small Python embedding:
104104
```java
105105
package interop;
106106
107107
import org.graalvm.polyglot.*;
108+
import org.graalvm.python.embedding.GraalPyResources;
108109
109110
class App {
110111
public static void main(String[] args) {
111-
try (var context = Context.create()) {
112+
try (var context = GraalPyResources.createContext()) {
112113
System.out.println(context.eval("python", "'Hello Python!'").asString());
113114
}
114115
}
@@ -157,7 +158,7 @@ In order to distribute the resulting application for other systems, follow these
157158
class App {
158159
...
159160
public static void main(String[] args) {
160-
try (Context context = GraalPyResources.createContext()) {
161+
try (Context context = GraalPyResources.contextBuilder().build()) {
161162
String src = """
162163
from termcolor import colored
163164
colored_text = colored("hello java", "red", attrs=["reverse", "blink"])

docs/user/Test-Tiers.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ Pure Python code runs reliably on GraalPy with recent JDKs when JIT compilation
4141

4242
| Platform | Notes |
4343
|---------------------------------|----------------------------------------------|
44-
| amd64-macos-darwin-graal-latest | macOS on Intel CPUs running Big Sur or newer. |
4544
| amd64-windows-msvc-graal-latest | Windows 11, Windows Server 2025, or newer. |
4645
| amd64-linux-glibc-oracle-21 | JDK 21 is tested without JIT compilation. |
4746
| aarch64-linux-glibc-oracle-21 | JDK 21 is tested without JIT compilation. |

graalpython/com.oracle.graal.python.annotations/src/com/oracle/graal/python/annotations/PythonOS.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2021, 2026, 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
@@ -48,7 +48,7 @@ public enum PythonOS {
4848
PLATFORM_WIN32("win32", "Windows"),
4949
PLATFORM_ANY(null, null);
5050

51-
public static final String SUPPORTED_PLATFORMS = "linux/amd64, linux/aarch64, macos/amd64, macos/aarch64, and windows/amd64";
51+
public static final String SUPPORTED_PLATFORMS = "linux/amd64, linux/aarch64, macos/aarch64, and windows/amd64";
5252

5353
private final String name;
5454
private final String uname;

0 commit comments

Comments
 (0)