1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fastimport,
6 fetchFromGitHub,
7 gevent,
8 geventhttpclient,
9 git,
10 glibcLocales,
11 gnupg,
12 gpgme,
13 paramiko,
14 pytestCheckHook,
15 pythonOlder,
16 setuptools,
17 setuptools-rust,
18 urllib3,
19}:
20
21buildPythonPackage rec {
22 pname = "dulwich";
23 version = "0.22.8";
24 pyproject = true;
25
26 disabled = pythonOlder "3.9";
27
28 src = fetchFromGitHub {
29 owner = "jelmer";
30 repo = "dulwich";
31 tag = "dulwich-${version}";
32 hash = "sha256-T0Tmu5sblTkqiak9U4ltkGbWw8ZE91pTlhPVMRi5Pxk=";
33 };
34
35 build-system = [
36 setuptools
37 setuptools-rust
38 ];
39
40 propagatedBuildInputs = [
41 urllib3
42 ];
43
44 optional-dependencies = {
45 fastimport = [ fastimport ];
46 https = [ urllib3 ];
47 pgp = [
48 gpgme
49 gnupg
50 ];
51 paramiko = [ paramiko ];
52 };
53
54 nativeCheckInputs = [
55 gevent
56 geventhttpclient
57 git
58 glibcLocales
59 pytestCheckHook
60 ] ++ lib.flatten (lib.attrValues optional-dependencies);
61
62 pytestFlagsArray = [ "tests" ];
63
64 disabledTests = [
65 # AssertionError: 'C:\\\\foo.bar\\\\baz' != 'C:\\foo.bar\\baz'
66 "test_file_win"
67 ];
68
69 disabledTestPaths = [
70 # requires swift config file
71 "tests/contrib/test_swift_smoke.py"
72 ];
73
74 doCheck = !stdenv.hostPlatform.isDarwin;
75
76 pythonImportsCheck = [ "dulwich" ];
77
78 meta = with lib; {
79 description = "Implementation of the Git file formats and protocols";
80 longDescription = ''
81 Dulwich is a Python implementation of the Git file formats and protocols, which
82 does not depend on Git itself. All functionality is available in pure Python.
83 '';
84 homepage = "https://www.dulwich.io/";
85 changelog = "https://github.com/jelmer/dulwich/blob/dulwich-${src.tag}/NEWS";
86 license = with licenses; [
87 asl20
88 gpl2Plus
89 ];
90 maintainers = with maintainers; [ koral ];
91 };
92}