Skip to content

Commit 9e2c53d

Browse files
committed
minor cleanups to mx
1 parent d46cc51 commit 9e2c53d

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

mx.graalpython/mx_graalpython.py

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,21 @@ def punittest(args):
164164
unittest(args + ['--regex', r'(graal\.python)|(com\.oracle\.truffle\.tck\.tests)', "-Dgraal.TraceTruffleCompilation=true"])
165165

166166

167+
PYTHON_ARCHIVES = ["GRAALPYTHON-LAUNCHER",
168+
"GRAALPYTHON",
169+
"GRAALPYTHON_GRAALVM_SUPPORT"]
170+
PYTHON_NATIVE_PROJECTS = ["com.oracle.graal.python.parser.antlr",
171+
"com.oracle.graal.python.cext"]
172+
173+
167174
def nativebuild(args):
168-
mx.build(["--only", "com.oracle.graal.python.parser.antlr,com.oracle.graal.python.cext,GRAALPYTHON-LAUNCHER,GRAALPYTHON,GRAALPYTHON_GRAALVM_SUPPORT"])
175+
"Build the non-Java Python projects and archives"
176+
mx.build(["--only", ",".join(PYTHON_NATIVE_PROJECTS + PYTHON_ARCHIVES)])
169177

170178

171179
def nativeclean(args):
172-
mx.run(['find', SUITE.dir, '-name', '*.bc', '-delete'])
180+
"Clean the non-Java Python projects"
181+
mx.clean(["--dependencies", ",".join(PYTHON_NATIVE_PROJECTS)])
173182

174183

175184
def python3_unittests(args):
@@ -244,6 +253,7 @@ def python_build_svm(args):
244253

245254

246255
def python_svm(args):
256+
"Build and run the native graalpython image"
247257
mx.run_mx(_SVM_ARGS + ["build"])
248258
out = mx.OutputCapture()
249259
mx.run_mx(_SVM_ARGS + ["graalvm-home"], out=mx.TeeOutputCapture(out))
@@ -633,6 +643,7 @@ def update_import_cmd(args):
633643

634644

635645
def python_style_checks(args):
646+
"Check (and fix where possible) copyrights, eclipse formatting, and spotbugs"
636647
python_checkcopyrights(["--fix"])
637648
if not os.environ.get("ECLIPSE_EXE"):
638649
find_eclipse()
@@ -664,6 +675,8 @@ def python_checkcopyrights(args):
664675

665676

666677
def import_python_sources(args):
678+
"Update the inlined files from PyPy and CPython"
679+
667680
# mappings for files that are renamed
668681
mapping = {
669682
"_memoryview.c": "memoryobject.c",
@@ -879,6 +892,7 @@ def mx_post_parse_cmd_line(namespace):
879892

880893

881894
def python_coverage(args):
895+
"Generate coverage report either running python-junit gate or the gate passed as argument"
882896
mx.run_mx(['--jacoco-whitelist-package', 'com.oracle.graal.python', '--primary', 'gate', '--tags', args[0] if args else 'python-junit', '--jacocout', 'html'])
883897

884898

@@ -898,6 +912,6 @@ def python_coverage(args):
898912
'python-unittests': [python3_unittests, ''],
899913
'nativebuild': [nativebuild, ''],
900914
'nativeclean': [nativeclean, ''],
901-
'python-src-import': [import_python_sources, 'Update the inlined files from PyPy and CPython'],
902-
'python-coverage': [python_coverage, 'Generate coverage report either running python-junit gate or the gate passed as argument'],
915+
'python-src-import': [import_python_sources, ''],
916+
'python-coverage': [python_coverage, '[gate-tag]'],
903917
})

0 commit comments

Comments
 (0)