Skip to content

Commit 349135f

Browse files
committed
[GR-46395] Migrate Python language dists to modules.
PullRequest: graalpython/2857
2 parents 03ff58c + 89e299b commit 349135f

File tree

5 files changed

+62
-20
lines changed

5 files changed

+62
-20
lines changed

ci.jsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "overlay": "dd38e0d2b557eea22b7e0b558bec03da8855c01b" }
1+
{ "overlay": "5f610cdf7c2a99fd0b6b17434ef4fe42d01c64f1" }

graalpython/com.oracle.graal.python.test/src/tests/test_pickle.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2018, 2023, 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
@@ -66,5 +66,12 @@ def test_teeiterator(self):
6666
assert [16,17,18,19] == [next(teeit2) for i in range(1, 5)]
6767
assert [16,17,18,19] == [next(teeit) for i in range(1, 5)]
6868

69+
def test_is_builtin_on_enterprise(self):
70+
import sys
71+
if sys.implementation.name == "graalpy" and __graalpython__.is_managed_launcher():
72+
import _pickle
73+
assert "built-in" in repr(_pickle)
74+
75+
6976
if __name__ == '__main__':
7077
unittest.main()

graalpython/com.oracle.graal.python.test/src/tests/test_struct.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,3 +269,11 @@ def test_pack_varargs():
269269
except TypeError:
270270
raised = True
271271
assert raised
272+
273+
274+
def test_struct_is_builtin_on_enterprise():
275+
if sys.implementation.name == "graalpy" and __graalpython__.is_managed_launcher():
276+
# none of these should fail
277+
import __graalpython_enterprise__
278+
import _struct
279+
assert "built-in" in repr(_struct)

mx.graalpython/mx_graalpython.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ def do_run_python(args, extra_vm_args=None, env=None, jdk=None, extra_dists=None
245245
dists = [dep for dep in x.deps if dep.isJavaProject() or dep.isJARDistribution()]
246246
else:
247247
dists = ['GRAALPYTHON']
248-
dists += ['TRUFFLE_NFI', 'SULONG_NATIVE']
248+
dists += ['TRUFFLE_NFI', 'SULONG_NATIVE', 'GRAALPYTHON-LAUNCHER']
249249

250250
vm_args, graalpython_args = mx.extract_VM_args(args, useDoubleDash=True, defaultAllVMArgs=False)
251251
if minimal:
@@ -1433,7 +1433,8 @@ def run_shared_lib_test(home, args=()):
14331433
}
14341434
14351435
poly_engine_builder engine_builder;
1436-
status = poly_create_engine_builder(isolate_thread, &engine_builder);
1436+
const char* permitted_languages[] = {"python"};
1437+
status = poly_create_engine_builder(isolate_thread, permitted_languages, 1, &engine_builder);
14371438
if (status != poly_ok) {
14381439
return status;
14391440
}

mx.graalpython/suite.py

Lines changed: 42 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,31 +44,31 @@
4444
},
4545
{
4646
"name": "sdk",
47-
"version": "94c1573a7d826751192eede90f8963b2ad5d460a",
47+
"version": "e719fdc44f86e90c73298e2d5754eeb97eb6e541",
4848
"subdir": True,
4949
"urls": [
5050
{"url": "https://github.com/oracle/graal", "kind": "git"},
5151
]
5252
},
5353
{
5454
"name": "tools",
55-
"version": "94c1573a7d826751192eede90f8963b2ad5d460a",
55+
"version": "e719fdc44f86e90c73298e2d5754eeb97eb6e541",
5656
"subdir": True,
5757
"urls": [
5858
{"url": "https://github.com/oracle/graal", "kind": "git"},
5959
],
6060
},
6161
{
6262
"name": "sulong",
63-
"version": "94c1573a7d826751192eede90f8963b2ad5d460a",
63+
"version": "e719fdc44f86e90c73298e2d5754eeb97eb6e541",
6464
"subdir": True,
6565
"urls": [
6666
{"url": "https://github.com/oracle/graal", "kind": "git"},
6767
]
6868
},
6969
{
7070
"name": "regex",
71-
"version": "94c1573a7d826751192eede90f8963b2ad5d460a",
71+
"version": "e719fdc44f86e90c73298e2d5754eeb97eb6e541",
7272
"subdir": True,
7373
"urls": [
7474
{"url": "https://github.com/oracle/graal", "kind": "git"},
@@ -114,6 +114,7 @@
114114
"artifactId": "xz",
115115
"version": "1.8",
116116
},
117+
"moduleName": "org.tukaani.xz",
117118
},
118119
"XZ-5.2.6": {
119120
"urls": [
@@ -130,6 +131,7 @@
130131
"artifactId": "bcprov-jdk15on",
131132
"version": "1.68",
132133
},
134+
"moduleName": "org.bouncycastle.provider",
133135
},
134136
"BOUNCYCASTLE-PKIX": {
135137
"sha1": "81da950604ff0b2652348cbd2b48fde46ced9867",
@@ -139,6 +141,7 @@
139141
"artifactId": "bcpkix-jdk15on",
140142
"version": "1.68",
141143
},
144+
"moduleName": "org.bouncycastle.pkix",
142145
},
143146
"BZIP2": {
144147
"urls": [
@@ -765,6 +768,12 @@
765768
# --------------------------------------------------------------------------------------------------------------
766769
"distributions": {
767770
"GRAALPYTHON-LAUNCHER": {
771+
"moduleInfo" : {
772+
"name" : "org.graalvm.py.launcher",
773+
"exports" : [
774+
"com.oracle.graal.python.shell to com.oracle.graal.python.enterprise.shell",
775+
],
776+
},
768777
"dependencies": [
769778
"com.oracle.graal.python.shell",
770779
],
@@ -835,24 +844,33 @@
835844
"maven": True,
836845
},
837846

838-
"GRAALPYTHON_PEGPARSER": {
839-
"dependencies": [
840-
"com.oracle.graal.python.pegparser",
841-
],
842-
"exclude": [
843-
"truffle:ICU4J",
844-
],
845-
"description": "GraalPython PEG parser",
846-
"internal": True,
847-
},
848-
849847
"GRAALPYTHON": {
848+
"moduleInfo" : {
849+
"name" : "org.graalvm.py",
850+
"exports" : [
851+
"com.oracle.graal.python.builtins to org.graalvm.py.enterprise",
852+
"com.oracle.graal.python.builtins.objects.buffer to org.graalvm.py.enterprise",
853+
"com.oracle.graal.python.builtins.objects.bytes to org.graalvm.py.enterprise",
854+
"com.oracle.graal.python.builtins.objects.floats to org.graalvm.py.enterprise",
855+
"com.oracle.graal.python.builtins.objects.function to org.graalvm.py.enterprise",
856+
"com.oracle.graal.python.builtins.objects.ints to org.graalvm.py.enterprise",
857+
"com.oracle.graal.python.builtins.objects.object to org.graalvm.py.enterprise",
858+
"com.oracle.graal.python.lib to org.graalvm.py.enterprise",
859+
"com.oracle.graal.python.nodes to org.graalvm.py.enterprise",
860+
"com.oracle.graal.python.nodes.function to org.graalvm.py.enterprise",
861+
"com.oracle.graal.python.nodes.function.builtins to org.graalvm.py.enterprise",
862+
"com.oracle.graal.python.runtime.exception to org.graalvm.py.enterprise",
863+
"com.oracle.graal.python.util to org.graalvm.py.enterprise",
864+
],
865+
"uses": [
866+
"com.oracle.graal.python.builtins.PythonBuiltins",
867+
],
868+
},
850869
"dependencies": [
851870
"com.oracle.graal.python",
852871
"com.oracle.graal.python.frozen",
853872
],
854873
"distDependencies": [
855-
"GRAALPYTHON-LAUNCHER",
856874
"GRAALPYTHON_NATIVE_LIBS",
857875
"truffle:TRUFFLE_API",
858876
"tools:TRUFFLE_COVERAGE",
@@ -862,6 +880,14 @@
862880
"sulong:SULONG_API",
863881
"sulong:SULONG_NATIVE", # this is actually just a runtime dependency
864882
],
883+
"requires": [
884+
"java.base",
885+
"java.logging",
886+
"java.management",
887+
"jdk.management",
888+
"jdk.unsupported",
889+
"jdk.security.auth",
890+
],
865891
"exclude": [
866892
"BOUNCYCASTLE-PROVIDER",
867893
"BOUNCYCASTLE-PKIX",

0 commit comments

Comments
 (0)