diff --git a/hatch_build.py b/hatch_build.py index fca67e502..deb21ff47 100644 --- a/hatch_build.py +++ b/hatch_build.py @@ -11,15 +11,21 @@ def initialize(self, version, build_data): sys.path.insert(0, here) from ipykernel.kernelspec import make_ipkernel_cmd, write_kernel_spec + overrides = {} + # When building a standard wheel, the executable specified in the kernelspec is simply 'python'. if version == "standard": + overrides["metadata"] = dict(debugger=True) argv = make_ipkernel_cmd(executable="python") # When installing an editable wheel, the full `sys.executable` can be used. else: argv = make_ipkernel_cmd() + overrides["argv"] = argv + dest = os.path.join(here, "data_kernelspec") if os.path.exists(dest): shutil.rmtree(dest) - write_kernel_spec(dest, overrides={"argv": argv}) + + write_kernel_spec(dest, overrides=overrides)