Skip to content

Commit 55f81a8

Browse files
committed
[GR-21590] Update imports
PullRequest: graalpython/853
2 parents 689bdb8 + 53882bb commit 55f81a8

File tree

5 files changed

+46
-34
lines changed

5 files changed

+46
-34
lines changed

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,19 @@ Python3.g4.stamp
5454
/graalpython/com.oracle.graal.python.test/src/tests/cpyext/Py*.c
5555
/graalpython/com.oracle.graal.python.test/src/tests/cpyext/Test*.c
5656
/graalpython/com.oracle.graal.python.test/src/tests/cpyext/*.sha256
57+
/graalpython/com.oracle.graal.python.test/src/tests/cpyext/buffer.c
58+
/graalpython/com.oracle.graal.python.test/src/tests/cpyext/format_specifier_w_star.c
59+
/graalpython/com.oracle.graal.python.test/src/tests/cpyext/memoryview_member_flags.c
60+
/graalpython/com.oracle.graal.python.test/src/tests/cpyext/parseargs_H.c
61+
/graalpython/com.oracle.graal.python.test/src/tests/cpyext/parseargs_I.c
62+
/graalpython/com.oracle.graal.python.test/src/tests/cpyext/parseargs_K.c
63+
/graalpython/com.oracle.graal.python.test/src/tests/cpyext/parseargs_O_conv.c
64+
/graalpython/com.oracle.graal.python.test/src/tests/cpyext/parseargs_O_typecheck.c
65+
/graalpython/com.oracle.graal.python.test/src/tests/cpyext/parseargs_S.c
66+
/graalpython/com.oracle.graal.python.test/src/tests/cpyext/parseargs_U.c
67+
/graalpython/com.oracle.graal.python.test/src/tests/cpyext/parseargs_valist.c
68+
/graalpython/com.oracle.graal.python.test/src/tests/cpyext/parseargs_Y.c
69+
/graalpython/com.oracle.graal.python.test/src/tests/cpyext/PointerEquality_Primitive.c
5770
/*.diff
5871
/testenv
5972
## generated from: pyhocon -i ci.hocon -f json -o ci.json

ci.jsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "overlay": "05cd3bf109fc28e21f72b06e1265e07aa2d40c28" }
1+
{ "overlay": "09507fb376d10830a267af39035f2bd20f83c294" }

graalpython/com.oracle.graal.python.test/src/com/oracle/graal/python/test/debug/PythonDebugTest.java

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,13 @@ public void testInlineEvaluation() throws Throwable {
202202
expectSuspended((SuspendedEvent event) -> {
203203
DebugStackFrame frame = event.getTopStackFrame();
204204
assertEquals(5, frame.getSourceSection().getStartLine());
205-
assertEquals("3", frame.eval("a + b").as(String.class));
205+
assertEquals("3", frame.eval("a + b").toDisplayString());
206206
event.prepareContinue();
207207
});
208208
expectSuspended((SuspendedEvent event) -> {
209209
DebugStackFrame frame = event.getTopStackFrame();
210210
assertEquals(7, frame.getSourceSection().getStartLine());
211-
assertEquals("6", frame.eval("bar() * 2").as(String.class));
211+
assertEquals("6", frame.eval("bar() * 2").toDisplayString());
212212
event.prepareContinue();
213213
});
214214
assertEquals("10", tester.expectDone());
@@ -238,8 +238,8 @@ public void testConditionalBreakpointInFunction() throws Throwable {
238238
expectSuspended((SuspendedEvent event) -> {
239239
DebugStackFrame frame = event.getTopStackFrame();
240240
assertEquals(9, frame.getSourceSection().getStartLine());
241-
assertEquals("10", frame.eval("sum").as(String.class));
242-
assertEquals("16", frame.eval("prod(4)").as(String.class));
241+
assertEquals("10", frame.eval("sum").toDisplayString());
242+
assertEquals("16", frame.eval("prod(4)").toDisplayString());
243243
event.prepareContinue();
244244
});
245245
assertEquals("45", tester.expectDone());
@@ -253,7 +253,7 @@ public void testConditionalBreakpointInFunction() throws Throwable {
253253
expectSuspended((SuspendedEvent event) -> {
254254
DebugStackFrame frame = event.getTopStackFrame();
255255
assertEquals(9, frame.getSourceSection().getStartLine());
256-
assertEquals("4", frame.eval("i").as(String.class));
256+
assertEquals("4", frame.eval("i").toDisplayString());
257257
event.prepareContinue();
258258
});
259259
assertEquals("45", tester.expectDone());
@@ -276,7 +276,7 @@ public void testConditionalBreakpointGlobal() throws Throwable {
276276
expectSuspended((SuspendedEvent event) -> {
277277
DebugStackFrame frame = event.getTopStackFrame();
278278
assertEquals(3, frame.getSourceSection().getStartLine());
279-
assertEquals("10", frame.eval("sum(values)").as(String.class));
279+
assertEquals("10", frame.eval("sum(values)").toDisplayString());
280280
event.prepareContinue();
281281
});
282282
assertEquals("45", tester.expectDone());
@@ -385,22 +385,22 @@ public void testGettersSetters() throws Throwable {
385385
assertTrue(x.hasWriteSideEffects());
386386
assertTrue(x.isReadable());
387387
assertTrue(x.isWritable());
388-
assertEquals(0, p.getProperty("__nx").as(Number.class).intValue());
389-
assertEquals("None", x.as(String.class));
390-
assertEquals(1, p.getProperty("__nx").as(Number.class).intValue());
388+
assertEquals(0, p.getProperty("__nx").asInt());
389+
assertEquals("None", x.toDisplayString());
390+
assertEquals(1, p.getProperty("__nx").asInt());
391391
x.set(42);
392-
assertEquals(2, p.getProperty("__nx").as(Number.class).intValue());
393-
assertEquals("42", x.as(String.class));
394-
assertEquals(3, p.getProperty("__nx").as(Number.class).intValue());
392+
assertEquals(2, p.getProperty("__nx").asInt());
393+
assertEquals("42", x.toDisplayString());
394+
assertEquals(3, p.getProperty("__nx").asInt());
395395
DebugValue y = p.getProperty("y");
396396
assertTrue(y.hasReadSideEffects());
397397
assertFalse(y.hasWriteSideEffects());
398398
assertTrue(y.isReadable());
399399
assertTrue(y.isWritable());
400400
DebugValue ny = p.getProperty("__ny");
401-
assertEquals(0, ny.as(Number.class).intValue());
401+
assertEquals(0, ny.asInt());
402402
y.set(24);
403-
assertEquals("24", y.as(String.class));
403+
assertEquals("24", y.toDisplayString());
404404
});
405405
}
406406
}
@@ -427,25 +427,25 @@ public void testInspectJavaArray() throws Throwable {
427427
// Truffle will now use our language to get a Python view on the primitive object
428428
// for inspection
429429
intValue.getMetaObject();
430-
assertEquals("0", intValue.as(String.class));
430+
assertEquals("0", intValue.toDisplayString());
431431
DebugValue longValue = globalScope.getDeclaredValue("a_long").getArray().get(0);
432432
longValue.getMetaObject();
433-
assertEquals("0", longValue.as(String.class));
433+
assertEquals("0", longValue.toDisplayString());
434434
DebugValue shortValue = globalScope.getDeclaredValue("a_short").getArray().get(0);
435435
shortValue.getMetaObject();
436-
assertEquals("0", shortValue.as(String.class));
436+
assertEquals("0", shortValue.toDisplayString());
437437
DebugValue byteValue = globalScope.getDeclaredValue("a_byte").getArray().get(0);
438438
byteValue.getMetaObject();
439-
assertEquals("0", byteValue.as(String.class));
439+
assertEquals("0", byteValue.toDisplayString());
440440
DebugValue floatValue = globalScope.getDeclaredValue("a_float").getArray().get(0);
441441
floatValue.getMetaObject();
442-
assertEquals("0.0", floatValue.as(String.class));
442+
assertEquals("0.0", floatValue.toDisplayString());
443443
DebugValue doubleValue = globalScope.getDeclaredValue("a_double").getArray().get(0);
444444
doubleValue.getMetaObject();
445-
assertEquals("0.0", doubleValue.as(String.class));
445+
assertEquals("0.0", doubleValue.toDisplayString());
446446
DebugValue charValue = globalScope.getDeclaredValue("a_char").getArray().get(0);
447447
charValue.getMetaObject();
448-
assertEquals("'\\x00'", charValue.as(String.class));
448+
assertEquals("'\\x00'", charValue.toDisplayString());
449449
});
450450
}
451451
}
@@ -525,7 +525,7 @@ private static void checkDebugValues(String msg, Iterable<DebugValue> values, St
525525
String expectedValue = expectedFrame[i + 1];
526526
DebugValue value = valMap.get(expectedIdentifier);
527527
assertNotNull(expectedIdentifier + " not found", value);
528-
assertEquals(expectedValue, value.as(String.class));
528+
assertEquals(expectedValue, value.toDisplayString());
529529
}
530530
}
531531

mx.graalpython/mx_graalpython.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -848,12 +848,6 @@ def update_import_cmd(args):
848848
update_import(name, suite_py, rev=("HEAD" if idx else "origin/master"))
849849

850850
# copy files we inline from our imports
851-
shutil.copy(
852-
join(mx.dependency("SULONG_LEGACY").output, "include", "truffle.h"),
853-
join(SUITE.dir, "graalpython", "com.oracle.graal.python.cext", "include", "truffle.h"))
854-
shutil.copy(
855-
join(mx.dependency("SULONG_HOME").output, "include", "polyglot.h"),
856-
join(SUITE.dir, "graalpython", "com.oracle.graal.python.cext", "include", "polyglot.h"))
857851
shutil.copy(
858852
join(mx.suite("truffle").dir, "..", "common.json"),
859853
join(overlaydir, "python", "graal-common.json"))
@@ -868,10 +862,15 @@ def update_import_cmd(args):
868862
repos_updated.append(overlaydir)
869863

870864
# now allow dependent repos to hook into update
865+
output = mx.OutputCapture()
871866
for repo in repos:
872-
cmdname = "%s-update-import" % os.path.basename(repo)
873-
if mx.run_mx(["help", cmdname], nonZeroIsFatal=False, quiet=True) == 0:
867+
basename = os.path.basename(repo)
868+
cmdname = "%s-update-import" % basename
869+
is_mx_command = mx.run_mx(["help", cmdname], out=output, err=output, nonZeroIsFatal=False, quiet=True) == 0
870+
if is_mx_command:
874871
mx.run_mx([cmdname, "--overlaydir=%s" % overlaydir], suite=repo, nonZeroIsFatal=True)
872+
else:
873+
print(mx.colorize('%s command for %s.. skipped!' % (cmdname, basename), color='magenta', bright=True, stream=sys.stdout))
875874

876875
# update ci import in all our repos, commit the full update, and push verbosely
877876
prev_verbosity = mx._opts.very_verbose
@@ -889,7 +888,7 @@ def update_import_cmd(args):
889888
repos_updated.append(repo)
890889

891890
if repos_updated:
892-
mx.log("These repos were updated: " + ", ".join(repos_updated))
891+
mx.log("\n ".join(["These repos were updated:"] + repos_updated))
893892

894893

895894
def python_style_checks(args):

mx.graalpython/suite.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@
4444
},
4545
{
4646
"name": "sulong",
47-
"version": "103af55f4782b9925d4bd2520574dfa35545edf4",
47+
"version": "16c6f1528e463c5a7b67a581d9c98f8f52018649",
4848
"subdir": True,
4949
"urls": [
5050
{"url": "https://github.com/oracle/graal", "kind": "git"},
5151
]
5252
},
5353
{
5454
"name": "regex",
55-
"version": "103af55f4782b9925d4bd2520574dfa35545edf4",
55+
"version": "16c6f1528e463c5a7b67a581d9c98f8f52018649",
5656
"subdir": True,
5757
"urls": [
5858
{"url": "https://github.com/oracle/graal", "kind": "git"},

0 commit comments

Comments
 (0)