From 89b60309ecda8e1616bc760b8acb2fc8fb23f1a5 Mon Sep 17 00:00:00 2001 From: Min RK Date: Mon, 8 Sep 2025 08:17:43 -0700 Subject: [PATCH] fix sys.executable in wheel kernelspec kernelspec should not reference absolute path to sys.executable, which results in non-portable wheels `python` is handled specially to invoke the current env --- hatch_build.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hatch_build.py b/hatch_build.py index 2ed5700..4a69984 100644 --- a/hatch_build.py +++ b/hatch_build.py @@ -3,17 +3,16 @@ from hatchling.builders.hooks.plugin.interface import BuildHookInterface -import argparse import json -import os -import sys import shutil from jupyter_client.kernelspec import KernelSpecManager from tempfile import TemporaryDirectory +# use 'python' executable for portable wheels +# kernel_json = { - "argv": [sys.executable, "-m", "echo_kernel", "-f", "{connection_file}"], + "argv": ["python", "-m", "echo_kernel", "-f", "{connection_file}"], "display_name": "Echo", "language": "text", }