Skip to content

Commit ddf8e67

Browse files
committed
[GR-50709] Update versions of maven and jbang projects to release versions.
PullRequest: graalpython/3132
2 parents 38357dc + 01b48d6 commit ddf8e67

File tree

9 files changed

+45
-32
lines changed

9 files changed

+45
-32
lines changed

graalpython/com.oracle.graal.python.test/src/tests/standalone/test_standalone.py

+16-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
22
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
33
#
44
# The Universal Permissive License (UPL), Version 1.0
@@ -99,6 +99,16 @@ def get_gp():
9999

100100
return graalpy
101101

102+
103+
def get_graalvm_version():
104+
graalvmVersion, _ = run_cmd([get_gp(), "-c", "print(__graalpython__.get_graalvm_version(), end='')"], os.environ.copy())
105+
# when JLine is cannot detect a terminal, it prints logging info
106+
graalvmVersion = graalvmVersion.split("\n")[-1]
107+
# we never test -dev versions here, we always pretend to use release versions
108+
graalvmVersion = graalvmVersion.split("-dev")[0]
109+
return graalvmVersion
110+
111+
102112
class PolyglotAppTest(unittest.TestCase):
103113

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

118126
for custom_repo in os.environ.get("MAVEN_REPO_OVERRIDE", "").split(","):
119127
url = urllib.parse.urlparse(custom_repo)
@@ -392,7 +400,8 @@ def test_native_executable_one_file():
392400
graalpy = get_gp()
393401
if graalpy is None:
394402
return
395-
env = os.environ.copy()
403+
env = os.environ.copy()
404+
env["MVN_GRAALPY_VERSION"] = get_graalvm_version()
396405

397406
with tempfile.TemporaryDirectory() as tmpdir:
398407

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

421431
with tempfile.TemporaryDirectory() as target_dir:
422432
source_file = os.path.join(target_dir, "hello.py")
@@ -453,6 +463,7 @@ def test_native_executable_module():
453463
if graalpy is None:
454464
return
455465
env = os.environ.copy()
466+
env["MVN_GRAALPY_VERSION"] = get_graalvm_version()
456467

457468
with tempfile.TemporaryDirectory() as tmp_dir:
458469

graalpython/graalpy-archetype-polyglot-app/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ SOFTWARE.
4444

4545
<groupId>org.graalvm.python</groupId>
4646
<artifactId>graalpy-archetype-polyglot-app</artifactId>
47-
<version>24.0.0-dev</version>
47+
<version>24.0.0</version>
4848
<packaging>maven-archetype</packaging>
4949

5050
<properties>

graalpython/graalpy-archetype-polyglot-app/src/main/resources/archetype-resources/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#set( $symbol_dollar = '$' )
1212
<properties>
13-
<graalpy.version>24.0.0-dev</graalpy.version>
13+
<graalpy.version>24.0.0</graalpy.version>
1414
<graalpy.edition>python-community</graalpy.edition>
1515
<maven.compiler.target>17</maven.compiler.target>
1616
<maven.compiler.source>17</maven.compiler.source>

graalpython/graalpy-jbang/examples/hello.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@
4040
*/
4141
///usr/bin/env jbang "$0" "$@" ; exit $?
4242

43-
//DEPS org.graalvm.python:python-language:24.0.0-dev
44-
//DEPS org.graalvm.python:python-resources:24.0.0-dev
45-
//DEPS org.graalvm.python:python-launcher:24.0.0-dev
46-
//DEPS org.graalvm.python:python-embedding:24.0.0-dev
43+
//DEPS org.graalvm.python:python-language:24.0.0
44+
//DEPS org.graalvm.python:python-resources:24.0.0
45+
//DEPS org.graalvm.python:python-launcher:24.0.0
46+
//DEPS org.graalvm.python:python-embedding:24.0.0
4747
//PIP termcolor
4848

4949
import org.graalvm.polyglot.Context;

graalpython/graalpy-jbang/templates/graalpy-template.java.qute

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
{/for}
55
{#if dependencies.isEmpty()}// //DEPS <dependency1> <dependency2>{/if}
66

7-
//DEPS org.graalvm.python:python-language:24.0.0-dev
8-
//DEPS org.graalvm.python:python-resources:24.0.0-dev
9-
//DEPS org.graalvm.python:python-launcher:24.0.0-dev
10-
//DEPS org.graalvm.python:python-embedding:24.0.0-dev
7+
//DEPS org.graalvm.python:python-language:24.0.0
8+
//DEPS org.graalvm.python:python-resources:24.0.0
9+
//DEPS org.graalvm.python:python-launcher:24.0.0
10+
//DEPS org.graalvm.python:python-embedding:24.0.0
1111
//PIP termcolor
1212

1313
import org.graalvm.polyglot.Context;

graalpython/graalpy-jbang/templates/graalpy-template_local_repo.java.qute

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77
//REPOS mc=https://repo1.maven.org/maven2/
88
//REPOS local=file://{path_to_local_repo}
9-
//DEPS org.graalvm.python:python-language:24.0.0-dev
10-
//DEPS org.graalvm.python:python-resources:24.0.0-dev
11-
//DEPS org.graalvm.python:python-launcher:24.0.0-dev
12-
//DEPS org.graalvm.python:python-embedding:24.0.0-dev
9+
//DEPS org.graalvm.python:python-language:24.0.0
10+
//DEPS org.graalvm.python:python-resources:24.0.0
11+
//DEPS org.graalvm.python:python-launcher:24.0.0
12+
//DEPS org.graalvm.python:python-embedding:24.0.0
1313
//PIP termcolor
1414

1515
import org.graalvm.polyglot.Context;

graalpython/graalpy-maven-plugin/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ SOFTWARE.
4747
<groupId>org.graalvm.python</groupId>
4848
<artifactId>graalpy-maven-plugin</artifactId>
4949
<packaging>maven-plugin</packaging>
50-
<version>24.0.0-dev</version>
50+
<version>24.0.0</version>
5151
<name>graalpy-maven-plugin</name>
5252

5353
<properties>
5454
<maven.compiler.target>17</maven.compiler.target>
5555
<maven.compiler.source>17</maven.compiler.source>
5656
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
57-
<graalpy.version>24.0.0-dev</graalpy.version>
57+
<graalpy.version>24.0.0</graalpy.version>
5858
</properties>
5959

6060
<build>

mx.graalpython/mx_graalpython.py

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2018, 2023, Oracle and/or its affiliates.
1+
# Copyright (c) 2018, 2024, Oracle and/or its affiliates.
22
# Copyright (c) 2013, Regents of the University of California
33
#
44
# All rights reserved.
@@ -935,8 +935,7 @@ def deploy_local_maven_repo():
935935
# build GraalPy and all the necessary dependencies, so that we can deploy them
936936
mx.run_mx(["build"])
937937
# deploy maven artifacts
938-
import mx_sdk_vm_impl
939-
version = mx_sdk_vm_impl.graalvm_version('graalvm')
938+
version = GRAAL_VERSION
940939
path = os.path.join(SUITE.get_mx_output_dir(), 'public-maven-repo')
941940
licenses = ['EPL-2.0', 'PSF-License', 'GPLv2-CPE', 'ICU,GPLv2', 'BSD-simplified', 'BSD-new', 'UPL', 'MIT']
942941
deploy_args = [
@@ -954,7 +953,7 @@ def deploy_local_maven_repo():
954953
mx.rmtree(path, ignore_errors=True)
955954
os.mkdir(path)
956955
mx.maven_deploy(deploy_args)
957-
return path
956+
return path, version
958957

959958

960959
def python_jvm(_=None):
@@ -1403,10 +1402,10 @@ def graalpython_gate_runner(args, tasks):
14031402
# JUnit tests with Maven
14041403
with Task('GraalPython integration JUnit with Maven', tasks, tags=[GraalPythonTags.junit_maven]) as task:
14051404
if task:
1406-
mvn_repo_path = pathlib.Path(deploy_local_maven_repo()).as_uri()
1405+
mvn_repo_path, artifacts_version = deploy_local_maven_repo()
1406+
mvn_repo_path = pathlib.Path(mvn_repo_path).as_uri()
14071407
central_override = mx_urlrewrites.rewriteurl('https://repo1.maven.org/maven2/')
14081408
pom_path = os.path.join(SUITE.dir, 'graalpython/com.oracle.graal.python.test.integration/pom.xml')
1409-
artifacts_version = GRAAL_VERSION + '-dev'
14101409
mvn_cmd_base = ['-f', pom_path,
14111410
f'-Dcom.oracle.graal.python.test.polyglot.version={artifacts_version}',
14121411
f'-Dcom.oracle.graal.python.test.polyglot_repo={mvn_repo_path}',
@@ -1481,14 +1480,13 @@ def graalpython_gate_runner(args, tasks):
14811480
'JAVA_HOME': graalvm_jdk(),
14821481
'PYTHON_STANDALONE_HOME': graalpy_standalone_home('jvm')
14831482
}
1484-
mvn_repo_path = deploy_local_maven_repo()
1483+
mvn_repo_path, version = deploy_local_maven_repo()
14851484
# setup maven downloader overrides
14861485
env['MAVEN_REPO_OVERRIDE'] = ",".join([
14871486
f"{pathlib.Path(mvn_repo_path).as_uri()}/",
14881487
mx_urlrewrites.rewriteurl('https://repo1.maven.org/maven2/'),
14891488
])
1490-
import mx_sdk_vm_impl
1491-
env["org.graalvm.maven.downloader.version"] = mx_sdk_vm_impl.graalvm_version('graalvm')
1489+
env["org.graalvm.maven.downloader.version"] = version
14921490
env["org.graalvm.maven.downloader.repository"] = f"{pathlib.Path(mvn_repo_path).as_uri()}/"
14931491
# run the test
14941492
mx.logv(f"running with os.environ extended with: {env=}")
@@ -2048,6 +2046,9 @@ def _python_checkpatchfiles():
20482046
'numpy-1.23.1.patch',
20492047
'numpy-1.23.4.patch',
20502048
'numpy-1.23.5.patch',
2049+
# pythran started putting the while license text in the field. It's MIT
2050+
'pythran-0.12.0.patch',
2051+
'pythran-0.13.patch',
20512052
# libcst is MIT
20522053
'libcst-1.0.1.patch',
20532054
# Empty license field, skip it. It's MIT

mx.graalpython/test_json_parsing.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
22
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
33
#
44
# The Universal Permissive License (UPL), Version 1.0
@@ -53,7 +53,8 @@
5353
import mx
5454
except ImportError:
5555
if mx_exe := shutil.which("mx"):
56-
sys.path.append(os.path.dirname(os.path.realpath(mx_exe)))
56+
mx_path = os.path.dirname(os.path.realpath(mx_exe))
57+
sys.path.append(os.path.join(mx_path, "src"))
5758

5859

5960
class TestJsonBenchmarkParsers(unittest.TestCase):

0 commit comments

Comments
 (0)