Skip to content

Commit 7c2b38e

Browse files
committed
use GRAALPY_VERSION or last released for jbang templates
1 parent cf39c9e commit 7c2b38e

File tree

4 files changed

+14
-37
lines changed

4 files changed

+14
-37
lines changed

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

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def ensureLocalMavenRepo(self):
119119
def clearCache(self):
120120
command = [JBANG_CMD, "cache", "clear"]
121121
out, result = run_cmd(command)
122-
122+
123123
def getCatalogFile(self):
124124
catalog_dir = os.path.dirname(os.path.abspath(__file__))
125125
for _ in range(5):
@@ -188,29 +188,6 @@ def test_catalog(self):
188188
file_path = os.path.normpath(os.path.join(os.path.dirname(self.catalog_file), file_ref))
189189
self.assertTrue(os.path.isfile(file_path), f"The path definied in catalog is not found: {file_path}")
190190

191-
@unittest.skipUnless(is_enabled, "ENABLE_JBANG_INTEGRATION_UNITTESTS is not true")
192-
def test_graal_version(self):
193-
json_data = self.getCatalogData(self.catalog_file)
194-
for alias in json_data.get("aliases", {}).values():
195-
script_ref = alias.get("script-ref")
196-
script_path = os.path.normpath(os.path.join(os.path.dirname(self.catalog_file), script_ref))
197-
with open(script_path, 'r') as script_file:
198-
content = script_file.read()
199-
self.assertIn (f"//DEPS org.graalvm.python:python-language:{GRAAL_VERSION}", content, f"//DEPS org.graalvm.python:python-language:{GRAAL_VERSION} was not found in {script_path}")
200-
self.assertIn (f"//DEPS org.graalvm.python:python-resources:{GRAAL_VERSION}", content, f"//DEPS org.graalvm.python:python-resources:{GRAAL_VERSION} was not found in {script_path}")
201-
self.assertIn (f"//DEPS org.graalvm.python:python-launcher:{GRAAL_VERSION}", content, f"//DEPS org.graalvm.python:python-launcher:{GRAAL_VERSION} was not found in {script_path}")
202-
self.assertIn (f"//DEPS org.graalvm.python:python-embedding:{GRAAL_VERSION}", content, f"//DEPS org.graalvm.python:python-embedding:{GRAAL_VERSION} was not found in {script_path}")
203-
204-
for template in json_data.get("templates", {}).values():
205-
for file_ref in template.get("file-refs", {}).values():
206-
file_path = os.path.normpath(os.path.join(os.path.dirname(self.catalog_file), file_ref))
207-
with open(script_path, 'r') as script_file:
208-
content = script_file.read()
209-
self.assertIn (f"//DEPS org.graalvm.python:python-language:{GRAAL_VERSION}", content, f"//DEPS org.graalvm.python:python-language:{GRAAL_VERSION} was not found in {script_path}")
210-
self.assertIn (f"//DEPS org.graalvm.python:python-resources:{GRAAL_VERSION}", content, f"//DEPS org.graalvm.python:python-resources:{GRAAL_VERSION} was not found in {script_path}")
211-
self.assertIn (f"//DEPS org.graalvm.python:python-launcher:{GRAAL_VERSION}", content, f"//DEPS org.graalvm.python:python-launcher:{GRAAL_VERSION} was not found in {script_path}")
212-
self.assertIn (f"//DEPS org.graalvm.python:python-embedding:{GRAAL_VERSION}", content, f"//DEPS org.graalvm.python:python-embedding:{GRAAL_VERSION} was not found in {script_path}")
213-
214191
@unittest.skipUnless(is_enabled, "ENABLE_JBANG_INTEGRATION_UNITTESTS is not true")
215192
def test_graalpy_template(self):
216193
template_name = "graalpy"
@@ -233,7 +210,7 @@ def test_graalpy_template(self):
233210

234211
self.assertTrue(result == 0, f"Execution failed with code {result}\n command: {command}\n stdout: {out}\n")
235212
self.assertTrue(expected_text in out, f"Expected text:\n{expected_text}\nbut in stdout was:\n{out}")
236-
213+
237214
@unittest.skipUnless(is_enabled, "ENABLE_JBANG_INTEGRATION_UNITTESTS is not true")
238215
@unittest.skipUnless('win32' not in sys.platform, "Currently the jbang native image on Win gate fails.")
239216
def test_graalpy_template_native(self):

graalpython/graalpy-jbang/examples/hello.java

Lines changed: 4 additions & 4 deletions
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.1.0
44-
//DEPS org.graalvm.python:python-resources:24.1.0
45-
//DEPS org.graalvm.python:python-launcher:24.1.0
46-
//DEPS org.graalvm.python:python-embedding:24.1.0
43+
//DEPS org.graalvm.python:python-language:${env.GRAALPY_VERSION:24.0.0}
44+
//DEPS org.graalvm.python:python-resources:${env.GRAALPY_VERSION:24.0.0}
45+
//DEPS org.graalvm.python:python-launcher:${env.GRAALPY_VERSION:24.0.0}
46+
//DEPS org.graalvm.python:python-embedding:${env.GRAALPY_VERSION:24.0.0}
4747
//PIP termcolor
4848

4949
import org.graalvm.polyglot.Context;

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

Lines changed: 4 additions & 4 deletions
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.1.0
8-
//DEPS org.graalvm.python:python-resources:24.1.0
9-
//DEPS org.graalvm.python:python-launcher:24.1.0
10-
//DEPS org.graalvm.python:python-embedding:24.1.0
7+
//DEPS org.graalvm.python:python-language:${env.GRAALPY_VERSION:24.0.0}
8+
//DEPS org.graalvm.python:python-resources:${env.GRAALPY_VERSION:24.0.0}
9+
//DEPS org.graalvm.python:python-launcher:${env.GRAALPY_VERSION:24.0.0}
10+
//DEPS org.graalvm.python:python-embedding:${env.GRAALPY_VERSION:24.0.0}
1111
//PIP termcolor
1212

1313
import org.graalvm.polyglot.Context;

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

Lines changed: 4 additions & 4 deletions
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.1.0
10-
//DEPS org.graalvm.python:python-resources:24.1.0
11-
//DEPS org.graalvm.python:python-launcher:24.1.0
12-
//DEPS org.graalvm.python:python-embedding:24.1.0
9+
//DEPS org.graalvm.python:python-language:${env.GRAALPY_VERSION:24.0.0}
10+
//DEPS org.graalvm.python:python-resources:${env.GRAALPY_VERSION:24.0.0}
11+
//DEPS org.graalvm.python:python-launcher:${env.GRAALPY_VERSION:24.0.0}
12+
//DEPS org.graalvm.python:python-embedding:${env.GRAALPY_VERSION:24.0.0}
1313
//PIP termcolor
1414

1515
import org.graalvm.polyglot.Context;

0 commit comments

Comments
 (0)