1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6 pythonOlder,
7
8 # build-system
9 hatchling,
10 hatch-vcs,
11
12 # dependencies
13 packaging,
14 requests,
15 urllib3,
16
17 # optional-dependencies
18 paramiko,
19 websocket-client,
20
21 # tests
22 pytestCheckHook,
23}:
24
25buildPythonPackage rec {
26 pname = "docker";
27 version = "7.1.0";
28 pyproject = true;
29
30 disabled = pythonOlder "3.8";
31
32 src = fetchFromGitHub {
33 owner = "docker";
34 repo = "docker-py";
35 tag = version;
36 hash = "sha256-sk6TZLek+fRkKq7kG9g6cR9lvfPC8v8qUXKb7Tq4pLU=";
37 };
38
39 build-system = [
40 hatchling
41 hatch-vcs
42 ];
43
44 dependencies = [
45 packaging
46 requests
47 urllib3
48 ];
49
50 optional-dependencies = {
51 ssh = [ paramiko ];
52 tls = [ ];
53 websockets = [ websocket-client ];
54 };
55
56 pythonImportsCheck = [ "docker" ];
57
58 nativeCheckInputs = [
59 pytestCheckHook
60 ]
61 ++ lib.flatten (lib.attrValues optional-dependencies);
62
63 enabledTestPaths = [ "tests/unit" ];
64
65 # Deselect socket tests on Darwin because it hits the path length limit for a Unix domain socket
66 disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [
67 "api_test"
68 "stream_response"
69 "socket_file"
70 ];
71
72 meta = with lib; {
73 changelog = "https://github.com/docker/docker-py/releases/tag/${version}";
74 description = "API client for docker written in Python";
75 homepage = "https://github.com/docker/docker-py";
76 license = licenses.asl20;
77 maintainers = [ ];
78 };
79}