about summary refs log tree commit diff
path: root/pkgs/development/python-modules/dulwich/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/dulwich/default.nix')
-rw-r--r--pkgs/development/python-modules/dulwich/default.nix57
1 files changed, 27 insertions, 30 deletions
diff --git a/pkgs/development/python-modules/dulwich/default.nix b/pkgs/development/python-modules/dulwich/default.nix
index 2a7ca19802b71..e4b3663dda90d 100644
--- a/pkgs/development/python-modules/dulwich/default.nix
+++ b/pkgs/development/python-modules/dulwich/default.nix
@@ -2,9 +2,9 @@
   lib,
   stdenv,
   buildPythonPackage,
-  certifi,
   fastimport,
   fetchFromGitHub,
+  fetchpatch2,
   gevent,
   geventhttpclient,
   git,
@@ -12,8 +12,7 @@
   gnupg,
   gpgme,
   paramiko,
-  pytest-xdist,
-  pytestCheckHook,
+  unittestCheckHook,
   pythonOlder,
   setuptools,
   setuptools-rust,
@@ -21,7 +20,7 @@
 }:
 
 buildPythonPackage rec {
-  version = "0.21.7";
+  version = "0.22.1";
   pname = "dulwich";
   format = "setuptools";
 
@@ -30,22 +29,30 @@ buildPythonPackage rec {
   src = fetchFromGitHub {
     owner = "jelmer";
     repo = "dulwich";
-    rev = "refs/tags/${pname}-${version}";
-    hash = "sha256-iP+6KtaQ8tfOobovSLSJZogS/XWW0LuHgE2oV8uQW/8=";
+    rev = "refs/tags/dulwich-${version}";
+    hash = "sha256-bf3ZUMX4afpdTBpFnx0HMyzCNG6V/p4eOl36djxGbtk=";
   };
 
+  patches = [
+    (fetchpatch2 {
+      name = "dulwich-geventhttpclient-api-breakage.patch";
+      url = "https://github.com/jelmer/dulwich/commit/5f0497de9c37ac4f4e8f27bed8decce13765d3df.patch";
+      hash = "sha256-0GgDgmYuLCsMc9nRRLNL2W6WYrkZ/1ZnZBQusEAzLKI=";
+    })
+  ];
+
   build-system = [
     setuptools
     setuptools-rust
   ];
 
   propagatedBuildInputs = [
-    certifi
     urllib3
   ];
 
-  passthru.optional-dependencies = {
+  optional-dependencies = {
     fastimport = [ fastimport ];
+    https = [ urllib3 ];
     pgp = [
       gpgme
       gnupg
@@ -59,32 +66,22 @@ buildPythonPackage rec {
       geventhttpclient
       git
       glibcLocales
-      pytest-xdist
-      pytestCheckHook
+      unittestCheckHook
     ]
-    ++ passthru.optional-dependencies.fastimport
-    ++ passthru.optional-dependencies.pgp
-    ++ passthru.optional-dependencies.paramiko;
+    ++ lib.flatten (lib.attrValues optional-dependencies);
 
-  doCheck = !stdenv.isDarwin;
+  preCheck = ''
+    # requires swift config file
+    rm tests/contrib/test_swift_smoke.py
 
-  disabledTests = [
-    # OSError: [Errno 84] Invalid or incomplete multibyte or wide character: b'/build/tmpsqwlbpd1/\xc0'
-    "test_no_decode_encode"
-    # OSError: [Errno 84] Invalid or incomplete multibyte or wide character: b'/build/tmpwmtfyvo2/refs.git/refs/heads/\xcd\xee\xe2\xe0\xff\xe2\xe5\xf2\xea\xe01'
-    "test_cyrillic"
-    # OSError: [Errno 84] Invalid or incomplete multibyte or wide character: b'/build/tmpfseetobk/test/\xc0'
-    "test_commit_no_encode_decode"
-    # https://github.com/jelmer/dulwich/issues/1279
-    "test_init_connector"
-  ];
+    # ImportError: attempted relative import beyond top-level package
+    rm tests/test_greenthreads.py
 
-  disabledTestPaths = [
-    # missing test inputs
-    "dulwich/contrib/test_swift_smoke.py"
-    # flaky on high core count >4
-    "dulwich/tests/compat/test_client.py"
-  ];
+    # git crashes; https://github.com/jelmer/dulwich/issues/1359
+    rm tests/compat/test_pack.py
+  '';
+
+  doCheck = !stdenv.hostPlatform.isDarwin;
 
   pythonImportsCheck = [ "dulwich" ];