1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 certifi,
6 fastimport,
7 fetchFromGitHub,
8 gevent,
9 geventhttpclient,
10 git,
11 glibcLocales,
12 gnupg,
13 gpgme,
14 paramiko,
15 pytest-xdist,
16 pytestCheckHook,
17 pythonOlder,
18 setuptools,
19 setuptools-rust,
20 urllib3,
21}:
22
23buildPythonPackage rec {
24 version = "0.21.7";
25 pname = "dulwich";
26 format = "setuptools";
27
28 disabled = pythonOlder "3.7";
29
30 src = fetchFromGitHub {
31 owner = "jelmer";
32 repo = "dulwich";
33 rev = "refs/tags/${pname}-${version}";
34 hash = "sha256-iP+6KtaQ8tfOobovSLSJZogS/XWW0LuHgE2oV8uQW/8=";
35 };
36
37 build-system = [
38 setuptools
39 setuptools-rust
40 ];
41
42 propagatedBuildInputs = [
43 certifi
44 urllib3
45 ];
46
47 passthru.optional-dependencies = {
48 fastimport = [ fastimport ];
49 pgp = [
50 gpgme
51 gnupg
52 ];
53 paramiko = [ paramiko ];
54 };
55
56 nativeCheckInputs =
57 [
58 gevent
59 geventhttpclient
60 git
61 glibcLocales
62 pytest-xdist
63 pytestCheckHook
64 ]
65 ++ passthru.optional-dependencies.fastimport
66 ++ passthru.optional-dependencies.pgp
67 ++ passthru.optional-dependencies.paramiko;
68
69 doCheck = !stdenv.isDarwin;
70
71 disabledTests = [
72 # OSError: [Errno 84] Invalid or incomplete multibyte or wide character: b'/build/tmpsqwlbpd1/\xc0'
73 "test_no_decode_encode"
74 # 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'
75 "test_cyrillic"
76 # OSError: [Errno 84] Invalid or incomplete multibyte or wide character: b'/build/tmpfseetobk/test/\xc0'
77 "test_commit_no_encode_decode"
78 # https://github.com/jelmer/dulwich/issues/1279
79 "test_init_connector"
80 ];
81
82 disabledTestPaths = [
83 # missing test inputs
84 "dulwich/contrib/test_swift_smoke.py"
85 # flaky on high core count >4
86 "dulwich/tests/compat/test_client.py"
87 ];
88
89 pythonImportsCheck = [ "dulwich" ];
90
91 meta = with lib; {
92 description = "Implementation of the Git file formats and protocols";
93 longDescription = ''
94 Dulwich is a Python implementation of the Git file formats and protocols, which
95 does not depend on Git itself. All functionality is available in pure Python.
96 '';
97 homepage = "https://www.dulwich.io/";
98 changelog = "https://github.com/jelmer/dulwich/blob/dulwich-${version}/NEWS";
99 license = with licenses; [
100 asl20
101 gpl2Plus
102 ];
103 maintainers = with maintainers; [ koral ];
104 };
105}