From 8965dab3a763b598f530122ba8a450af4c2447eb Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Tue, 22 Apr 2025 22:44:24 +0200 Subject: [PATCH] python312Packages.bash-kernel: cleanup, fix on darwin --- .../python-modules/bash-kernel/default.nix | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/pkgs/development/python-modules/bash-kernel/default.nix b/pkgs/development/python-modules/bash-kernel/default.nix index 6e546b311d3f..68bdbd190951 100644 --- a/pkgs/development/python-modules/bash-kernel/default.nix +++ b/pkgs/development/python-modules/bash-kernel/default.nix @@ -1,14 +1,15 @@ { lib, buildPythonPackage, - fetchPypi, + fetchFromGitHub, + replaceVars, + bashInteractive, flit-core, filetype, ipykernel, - python, pexpect, - bashInteractive, - replaceVars, + writableTmpDirAsHomeHook, + python, }: buildPythonPackage rec { @@ -16,10 +17,11 @@ buildPythonPackage rec { version = "0.10.0"; pyproject = true; - src = fetchPypi { - pname = "bash_kernel"; - inherit version; - hash = "sha256-LtWgpBbEGNHXUecVBb1siJ4SFXREtQxCh6aF2ndcKMo="; + src = fetchFromGitHub { + owner = "takluyver"; + repo = "bash_kernel"; + tag = version; + hash = "sha256-ugFMcQx1B1nKoO9rhb6PMllRcoZi0O4B9um8dOu5DU4="; }; patches = [ @@ -36,9 +38,9 @@ buildPythonPackage rec { pexpect ]; - preBuild = '' - export HOME=$TMPDIR - ''; + nativeBuildInputs = [ + writableTmpDirAsHomeHook + ]; postInstall = '' ${python.pythonOnBuildForHost.interpreter} -m bash_kernel.install --prefix $out @@ -59,6 +61,8 @@ buildPythonPackage rec { runHook postCheck ''; + __darwinAllowLocalNetworking = true; + meta = { description = "Bash Kernel for Jupyter"; homepage = "https://github.com/takluyver/bash_kernel";