Skip to content

Commit

Permalink
[GR-50709] Update versions of maven and jbang projects to release ver…
Browse files Browse the repository at this point in the history
…sions.

PullRequest: graalpython/3132
  • Loading branch information
timfel committed Jan 8, 2024
2 parents 38357dc + 01b48d6 commit ddf8e67
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 32 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2023, 2024, 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
Expand Down Expand Up @@ -99,6 +99,16 @@ def get_gp():

return graalpy


def get_graalvm_version():
graalvmVersion, _ = run_cmd([get_gp(), "-c", "print(__graalpython__.get_graalvm_version(), end='')"], os.environ.copy())
# when JLine is cannot detect a terminal, it prints logging info
graalvmVersion = graalvmVersion.split("\n")[-1]
# we never test -dev versions here, we always pretend to use release versions
graalvmVersion = graalvmVersion.split("-dev")[0]
return graalvmVersion


class PolyglotAppTest(unittest.TestCase):

def setUpClass(self):
Expand All @@ -111,9 +121,7 @@ def setUpClass(self):
self.archetypeGroupId = "org.graalvm.python"
self.archetypeArtifactId = "graalpy-archetype-polyglot-app"
self.pluginArtifactId = "graalpy-maven-plugin"
graalvmVersion, _ = run_cmd([get_gp(), "-c", "print(__graalpython__.get_graalvm_version(), end='')"], self.env)
# when JLine is cannot detect a terminal, it prints logging info
self.graalvmVersion = graalvmVersion.split("\n")[-1]
self.graalvmVersion = get_graalvm_version()

for custom_repo in os.environ.get("MAVEN_REPO_OVERRIDE", "").split(","):
url = urllib.parse.urlparse(custom_repo)
Expand Down Expand Up @@ -392,7 +400,8 @@ def test_native_executable_one_file():
graalpy = get_gp()
if graalpy is None:
return
env = os.environ.copy()
env = os.environ.copy()
env["MVN_GRAALPY_VERSION"] = get_graalvm_version()

with tempfile.TemporaryDirectory() as tmpdir:

Expand All @@ -417,6 +426,7 @@ def test_native_executable_venv_and_one_file():
if graalpy is None:
return
env = os.environ.copy()
env["MVN_GRAALPY_VERSION"] = get_graalvm_version()

with tempfile.TemporaryDirectory() as target_dir:
source_file = os.path.join(target_dir, "hello.py")
Expand Down Expand Up @@ -453,6 +463,7 @@ def test_native_executable_module():
if graalpy is None:
return
env = os.environ.copy()
env["MVN_GRAALPY_VERSION"] = get_graalvm_version()

with tempfile.TemporaryDirectory() as tmp_dir:

Expand Down
2 changes: 1 addition & 1 deletion graalpython/graalpy-archetype-polyglot-app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ SOFTWARE.

<groupId>org.graalvm.python</groupId>
<artifactId>graalpy-archetype-polyglot-app</artifactId>
<version>24.0.0-dev</version>
<version>24.0.0</version>
<packaging>maven-archetype</packaging>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#set( $symbol_dollar = '$' )
<properties>
<graalpy.version>24.0.0-dev</graalpy.version>
<graalpy.version>24.0.0</graalpy.version>
<graalpy.edition>python-community</graalpy.edition>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
Expand Down
8 changes: 4 additions & 4 deletions graalpython/graalpy-jbang/examples/hello.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
*/
///usr/bin/env jbang "$0" "$@" ; exit $?

//DEPS org.graalvm.python:python-language:24.0.0-dev
//DEPS org.graalvm.python:python-resources:24.0.0-dev
//DEPS org.graalvm.python:python-launcher:24.0.0-dev
//DEPS org.graalvm.python:python-embedding:24.0.0-dev
//DEPS org.graalvm.python:python-language:24.0.0
//DEPS org.graalvm.python:python-resources:24.0.0
//DEPS org.graalvm.python:python-launcher:24.0.0
//DEPS org.graalvm.python:python-embedding:24.0.0
//PIP termcolor

import org.graalvm.polyglot.Context;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
{/for}
{#if dependencies.isEmpty()}// //DEPS <dependency1> <dependency2>{/if}

//DEPS org.graalvm.python:python-language:24.0.0-dev
//DEPS org.graalvm.python:python-resources:24.0.0-dev
//DEPS org.graalvm.python:python-launcher:24.0.0-dev
//DEPS org.graalvm.python:python-embedding:24.0.0-dev
//DEPS org.graalvm.python:python-language:24.0.0
//DEPS org.graalvm.python:python-resources:24.0.0
//DEPS org.graalvm.python:python-launcher:24.0.0
//DEPS org.graalvm.python:python-embedding:24.0.0
//PIP termcolor

import org.graalvm.polyglot.Context;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

//REPOS mc=https://repo1.maven.org/maven2/
//REPOS local=file://{path_to_local_repo}
//DEPS org.graalvm.python:python-language:24.0.0-dev
//DEPS org.graalvm.python:python-resources:24.0.0-dev
//DEPS org.graalvm.python:python-launcher:24.0.0-dev
//DEPS org.graalvm.python:python-embedding:24.0.0-dev
//DEPS org.graalvm.python:python-language:24.0.0
//DEPS org.graalvm.python:python-resources:24.0.0
//DEPS org.graalvm.python:python-launcher:24.0.0
//DEPS org.graalvm.python:python-embedding:24.0.0
//PIP termcolor

import org.graalvm.polyglot.Context;
Expand Down
4 changes: 2 additions & 2 deletions graalpython/graalpy-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ SOFTWARE.
<groupId>org.graalvm.python</groupId>
<artifactId>graalpy-maven-plugin</artifactId>
<packaging>maven-plugin</packaging>
<version>24.0.0-dev</version>
<version>24.0.0</version>
<name>graalpy-maven-plugin</name>

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

<build>
Expand Down
19 changes: 10 additions & 9 deletions mx.graalpython/mx_graalpython.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2018, 2023, Oracle and/or its affiliates.
# Copyright (c) 2018, 2024, Oracle and/or its affiliates.
# Copyright (c) 2013, Regents of the University of California
#
# All rights reserved.
Expand Down Expand Up @@ -935,8 +935,7 @@ def deploy_local_maven_repo():
# build GraalPy and all the necessary dependencies, so that we can deploy them
mx.run_mx(["build"])
# deploy maven artifacts
import mx_sdk_vm_impl
version = mx_sdk_vm_impl.graalvm_version('graalvm')
version = GRAAL_VERSION
path = os.path.join(SUITE.get_mx_output_dir(), 'public-maven-repo')
licenses = ['EPL-2.0', 'PSF-License', 'GPLv2-CPE', 'ICU,GPLv2', 'BSD-simplified', 'BSD-new', 'UPL', 'MIT']
deploy_args = [
Expand All @@ -954,7 +953,7 @@ def deploy_local_maven_repo():
mx.rmtree(path, ignore_errors=True)
os.mkdir(path)
mx.maven_deploy(deploy_args)
return path
return path, version


def python_jvm(_=None):
Expand Down Expand Up @@ -1403,10 +1402,10 @@ def graalpython_gate_runner(args, tasks):
# JUnit tests with Maven
with Task('GraalPython integration JUnit with Maven', tasks, tags=[GraalPythonTags.junit_maven]) as task:
if task:
mvn_repo_path = pathlib.Path(deploy_local_maven_repo()).as_uri()
mvn_repo_path, artifacts_version = deploy_local_maven_repo()
mvn_repo_path = pathlib.Path(mvn_repo_path).as_uri()
central_override = mx_urlrewrites.rewriteurl('https://repo1.maven.org/maven2/')
pom_path = os.path.join(SUITE.dir, 'graalpython/com.oracle.graal.python.test.integration/pom.xml')
artifacts_version = GRAAL_VERSION + '-dev'
mvn_cmd_base = ['-f', pom_path,
f'-Dcom.oracle.graal.python.test.polyglot.version={artifacts_version}',
f'-Dcom.oracle.graal.python.test.polyglot_repo={mvn_repo_path}',
Expand Down Expand Up @@ -1481,14 +1480,13 @@ def graalpython_gate_runner(args, tasks):
'JAVA_HOME': graalvm_jdk(),
'PYTHON_STANDALONE_HOME': graalpy_standalone_home('jvm')
}
mvn_repo_path = deploy_local_maven_repo()
mvn_repo_path, version = deploy_local_maven_repo()
# setup maven downloader overrides
env['MAVEN_REPO_OVERRIDE'] = ",".join([
f"{pathlib.Path(mvn_repo_path).as_uri()}/",
mx_urlrewrites.rewriteurl('https://repo1.maven.org/maven2/'),
])
import mx_sdk_vm_impl
env["org.graalvm.maven.downloader.version"] = mx_sdk_vm_impl.graalvm_version('graalvm')
env["org.graalvm.maven.downloader.version"] = version
env["org.graalvm.maven.downloader.repository"] = f"{pathlib.Path(mvn_repo_path).as_uri()}/"
# run the test
mx.logv(f"running with os.environ extended with: {env=}")
Expand Down Expand Up @@ -2048,6 +2046,9 @@ def _python_checkpatchfiles():
'numpy-1.23.1.patch',
'numpy-1.23.4.patch',
'numpy-1.23.5.patch',
# pythran started putting the while license text in the field. It's MIT
'pythran-0.12.0.patch',
'pythran-0.13.patch',
# libcst is MIT
'libcst-1.0.1.patch',
# Empty license field, skip it. It's MIT
Expand Down
5 changes: 3 additions & 2 deletions mx.graalpython/test_json_parsing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2020, 2024, 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
Expand Down Expand Up @@ -53,7 +53,8 @@
import mx
except ImportError:
if mx_exe := shutil.which("mx"):
sys.path.append(os.path.dirname(os.path.realpath(mx_exe)))
mx_path = os.path.dirname(os.path.realpath(mx_exe))
sys.path.append(os.path.join(mx_path, "src"))


class TestJsonBenchmarkParsers(unittest.TestCase):
Expand Down

0 comments on commit ddf8e67

Please sign in to comment.