Skip to content

Commit bb07842

Browse files
committed
Improve path handling in patch check
1 parent 1c0026a commit bb07842

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

mx.graalpython/mx_graalpython.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2101,10 +2101,14 @@ def python_run_mx_filetests(args):
21012101

21022102
def _python_checkpatchfiles():
21032103
env = os.environ.copy()
2104-
env['PYTHONPATH'] = 'graalpython/lib-python/3/ensurepip/_bundled/pip-23.2.1-py3-none-any.whl'
21052104
mx_dir = Path(__file__).parent
2105+
root_dir = mx_dir.parent
2106+
[pip_wheel] = (root_dir / 'graalpython' / 'lib-python' / '3' / 'ensurepip' / '_bundled').glob('pip-*.whl')
2107+
env['PYTHONPATH'] = str(pip_wheel)
2108+
# We use the CPython that is used for running our unittests, not the one mx is running with.
2109+
# This is done to make sure it can import the pip wheel.
21062110
mx.run(
2107-
[get_cpython(), str(mx_dir / 'verify_patches.py'), str(mx_dir.parent / 'graalpython/lib-graalpython/patches')],
2111+
[get_cpython(), str(mx_dir / 'verify_patches.py'), str(root_dir / 'graalpython' / 'lib-graalpython' / 'patches')],
21082112
env=env,
21092113
nonZeroIsFatal=True,
21102114
)

0 commit comments

Comments
 (0)