1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 cryptography,
6 fetchFromGitHub,
7 pyspnego,
8 pytest-mock,
9 pytestCheckHook,
10 pythonOlder,
11}:
12
13buildPythonPackage rec {
14 pname = "smbprotocol";
15 version = "1.15.0";
16 format = "setuptools";
17
18 disabled = pythonOlder "3.7";
19
20 src = fetchFromGitHub {
21 owner = "jborean93";
22 repo = "smbprotocol";
23 tag = "v${version}";
24 hash = "sha256-4BIrJAYazU4Bm6V1bYW/Bw2MXpR7CQpGQ6JammJ75HI=";
25 };
26
27 propagatedBuildInputs = [
28 cryptography
29 pyspnego
30 ];
31
32 nativeCheckInputs = [
33 pytest-mock
34 pytestCheckHook
35 ];
36
37 disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [
38 # https://github.com/jborean93/smbprotocol/issues/119
39 "test_copymode_local_to_local_symlink_dont_follow"
40 "test_copystat_local_to_local_symlink_dont_follow_fail"
41
42 # fail in sandbox due to networking
43 "test_small_recv"
44 "test_recv_"
45 ];
46
47 pythonImportsCheck = [ "smbprotocol" ];
48
49 meta = with lib; {
50 description = "Python SMBv2 and v3 Client";
51 homepage = "https://github.com/jborean93/smbprotocol";
52 changelog = "https://github.com/jborean93/smbprotocol/releases/tag/${src.tag}";
53 license = with licenses; [ mit ];
54 maintainers = with maintainers; [ fab ];
55 };
56}