about summary refs log tree commit diff
path: root/pkgs/development/python-modules/walrus/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/walrus/default.nix')
-rw-r--r--pkgs/development/python-modules/walrus/default.nix38
1 files changed, 23 insertions, 15 deletions
diff --git a/pkgs/development/python-modules/walrus/default.nix b/pkgs/development/python-modules/walrus/default.nix
index 73376590bda3d..976037f928893 100644
--- a/pkgs/development/python-modules/walrus/default.nix
+++ b/pkgs/development/python-modules/walrus/default.nix
@@ -1,10 +1,12 @@
-{ lib
-, pkgs
-, buildPythonPackage
-, fetchFromGitHub
-, pythonOlder
-, redis
-, unittestCheckHook
+{
+  lib,
+  pkgs,
+  buildPythonPackage,
+  fetchFromGitHub,
+  pythonOlder,
+  redis,
+  unittestCheckHook,
+  fetchpatch,
 }:
 
 buildPythonPackage rec {
@@ -21,13 +23,19 @@ buildPythonPackage rec {
     hash = "sha256-jinYMGSBAY8HTg92qU/iU5vGIrrDr5SeQG0XjsBVfcc=";
   };
 
-  propagatedBuildInputs = [
-    redis
+  patches = [
+    # distutils has been deprecated, this wraps its import inside a try-catch
+    # and fallsback to a fallback import.
+    # Should not be necessary in future versions.
+    (fetchpatch {
+      url = "https://github.com/coleifer/walrus/commit/79e20c89aa4015017ef8a3e0b5c27ca2731dc9b2.patch";
+      hash = "sha256-hCpvki6SV3KYhicjjUMP4VrKMEerMjq2n1BgozXKDO8=";
+    })
   ];
 
-  nativeCheckInputs = [
-    unittestCheckHook
-  ];
+  propagatedBuildInputs = [ redis ];
+
+  nativeCheckInputs = [ unittestCheckHook ];
 
   preCheck = ''
     ${pkgs.redis}/bin/redis-server &
@@ -38,9 +46,9 @@ buildPythonPackage rec {
     kill $REDIS_PID
   '';
 
-  pythonImportsCheck = [
-    "walrus"
-  ];
+  pythonImportsCheck = [ "walrus" ];
+
+  __darwinAllowLocalNetworking = true;
 
   meta = with lib; {
     description = "Lightweight Python utilities for working with Redis";