Skip to content

Commit

Permalink
[GR-48446] [GR-48602] [GR-48747] [GR-48732] [GR-48685] [GR-46479] Bac…
Browse files Browse the repository at this point in the history
…kport: tests, fix of Sulong managed deployment, fix for platform tags on Darwin.

PullRequest: graalpython/2987
  • Loading branch information
steve-s committed Sep 25, 2023
2 parents 69b7b7a + b3b65e0 commit e9443f2
Show file tree
Hide file tree
Showing 91 changed files with 2,176 additions and 1,069 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,4 @@ graalpython.tests.src.zip.files/
graalpython.src.zip.files/
graalpython/com.oracle.graal.python.test/src/tests/patched_package/build/
graalpython/com.oracle.graal.python.test/src/tests/patched_package/src/patched_package.egg-info
graalpython/com.oracle.graal.python.test.integration/target
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ We welcome issue reports of all kinds and are working hard to close our compatib

The easiest option to try GraalPy is [pyenv](https://github.com/pyenv/pyenv/), the Python version manager.
It allows you to easily install different GraalPy releases.
To install version 22.3.0, for example, just run `pyenv install graalpy-22.3.0`.
To install version 23.1.0, for example, just run `pyenv install graalpy-community-23.1.0`.

Another option is to use [Conda-Forge](https://conda-forge.org/).
To get an environment with the latest version of GraalPy, use the following command:
Expand Down
2 changes: 1 addition & 1 deletion ci.jsonnet
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "overlay": "61d2e798a75f4b48457dda2d3b1d3f2ec83dace7" }
{ "overlay": "4fe59ff78899a09c836fbb7920c8558d5ed786e7" }
23 changes: 11 additions & 12 deletions docs/user/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ To distinguish between them, GraalPy Community has the suffix `-community` in th

```bash
# Oracle GraalPy
graalpy-VERSION-PLATFORM.tar.gz
graalpy-<version>-<os>-<arch>.tar.gz
# GraalPy Community
graalpy-community-VERSION-PLATFORM.tar.gz
graalpy-community-<version>-<os>-<arch>.tar.gz
```

Two language runtime options are available for both Oracle and Community GraalPy: Native and JVM.
In the Native configuration, GraalPy is ahead-of-time compiled to a standalone native executable.
This means that you do not need a JVM installed on your system to use it and it is size-compact.
In the JVM configuration, you can use Java interoperability easily, and peak performance may be higher than the native configuration.
A JVM standalone that comes with a JVM has the `-jvm` suffix in a name: `graalpy-jvm-<version>-<os>-<arch>.tar.gz`.
A JVM standalone that comes with a JVM has the `-jvm` suffix in the name: `graalpy-jvm-<version>-<os>-<arch>.tar.gz`.

| Configuration: | Native (default) | JVM |
| ------------------ | ---------------: | ------------: |
Expand All @@ -47,7 +47,7 @@ A JVM standalone that comes with a JVM has the `-jvm` suffix in a name: `graalpy

## Installing GraalPy

You can install GraalPy either using a Python manager or downloading a compressed GraalPy tarball appropriate for your platform.
You can install GraalPy by downloading a compressed GraalPy tarball appropriate for your platform. For GraalPy Community, you can also use `pyenv` or `conda`.

### Downloading

Expand All @@ -58,6 +58,7 @@ You can install GraalPy either using a Python manager or downloading a compresse
```shell
sudo xattr -r -d com.apple.quarantine <archive>.tar.gz
```

Now extract:
```shell
tar -xzf <archive>.tar.gz
Expand All @@ -68,19 +69,17 @@ You can install GraalPy either using a Python manager or downloading a compresse
./path/to/bin/graalpy --version
```

### Using `pyenv`
### Using `pyenv` (GraalPy Community only)
#### Linux and macOS

The other way to install GraalPy on Linux and macOS platforms is to use [pyenv](https://github.com/pyenv/pyenv/), the Python version manager.
For example, to install version 23.1.1, run the following command:
The other way to install GraalPy Community on Linux and macOS platforms is to use [pyenv](https://github.com/pyenv/pyenv/), the Python version manager.
For example, to install version 23.1.0, run the following command:

```bash
# To install Oracle GraalPy
pyenv install graalpy-23.1.1
# To install GraalPy Community
pyenv install graalpy-community-23.1.1
pyenv install graalpy-community-23.1.0
```

### Using Conda Forge (GraalPy Community only)
Another option is to use [Conda-Forge](https://conda-forge.org/).
To get an environment with the latest version of GraalPy, use the following command:

Expand Down Expand Up @@ -201,4 +200,4 @@ Learn more in a dedicated [GraalPy Interoperability guide](Interoperability.md).

## Related Documentation

* [Installing Supported Packages](Packages.md)
* [Installing Supported Packages](Packages.md)
170 changes: 170 additions & 0 deletions graalpython/com.oracle.graal.python.test.integration/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2023, 2023, Oracle and/or its affiliates. All rights reserved.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
The Universal Permissive License (UPL), Version 1.0
Subject to the condition set forth below, permission is hereby granted to any
person obtaining a copy of this software, associated documentation and/or
data (collectively the "Software"), free of charge and under any and all
copyright rights in the Software, and any and all patent rights owned or
freely licensable by each licensor hereunder covering either (i) the
unmodified Software as contributed to or provided by such licensor, or (ii)
the Larger Works (as defined below), to deal in both
(a) the Software, and
(b) any piece of software and/or hardware listed in the lrgrwrks.txt file if
one is included with the Software each a "Larger Work" to which the Software
is contributed by such licensors),
without restriction, including without limitation the rights to copy, create
derivative works of, display, perform, and distribute the Software and make,
use, sell, offer for sale, import, export, have made, and have sold the
Software and the Larger Work(s), and to sublicense the foregoing rights on
either these or other terms.
This license is subject to the following condition:
The above copyright notice and either this complete permission notice or at a
minimum a reference to the UPL must be included in all copies or substantial
portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-->
<!--
This Maven project can compile and run the integration unit tests independently of
the rest of the GraalPy sources on top of any supported JDK, e.g., OpenJDK, GraalVM JDK, etc.
When testing with custom Maven repository, i.e., locally built, one can pass -Dpolyglot_repo
pointing to the Maven repository, for example:
mvn test -Dpolyglot_repo=file:///some/path/to/repo
Additionally, one can change the polyglot artifacts version with
-Dpolyglot.version=24.0-SNAPSHOT, for example.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.oracle.graal.python.test</groupId>
<artifactId>integration</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<polyglot.version>23.1.1-dev</polyglot.version>
</properties>

<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>src</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit4</artifactId>
<version>2.22.0</version>
</dependency>
</dependencies>
<configuration>
<testSourceDirectory>src</testSourceDirectory>
<testClassesDirectory>${project.build.outputDirectory}</testClassesDirectory>
<includes>
<include>**/*.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>Custom central repo</id>
<activation>
<property>
<name>central_repo</name>
</property>
</activation>
<repositories>
<repository>
<id>release</id>
<url>${central_repo}</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
<profile>
<id>Custom polyglot repo</id>
<activation>
<property>
<name>polyglot_repo</name>
</property>
</activation>
<repositories>
<repository>
<id>release</id>
<url>${polyglot_repo}</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>

<dependencies>
<dependency>
<groupId>org.graalvm.polyglot</groupId>
<artifactId>polyglot</artifactId>
<version>${polyglot.version}</version>
</dependency>
<dependency>
<groupId>org.graalvm.polyglot</groupId>
<artifactId>python-community</artifactId>
<version>${polyglot.version}</version>
<scope>runtime</scope>
<type>pom</type>
</dependency>
<dependency>
<!-- See MultiContextTest#testSharingWithStruct -->
<groupId>org.graalvm.polyglot</groupId>
<artifactId>llvm-community</artifactId>
<version>${polyglot.version}</version>
<scope>runtime</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.oracle.graal.python.test;
package com.oracle.graal.python.test.integration;

import java.util.ArrayList;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.oracle.graal.python.test;
package com.oracle.graal.python.test.integration;

import static com.oracle.graal.python.test.integration.Utils.IS_WINDOWS;
import static org.junit.Assert.assertEquals;
import static org.junit.Assume.assumeFalse;

import org.graalvm.polyglot.Context;
import org.graalvm.polyglot.Engine;
Expand All @@ -50,6 +52,7 @@ public class EngineOptionsTests {

@Test
public void engineOptions() {
assumeFalse(IS_WINDOWS);
Engine engine = Engine.newBuilder().build();

assertEquals("java", doit(engine, null));
Expand Down
Loading

0 comments on commit e9443f2

Please sign in to comment.