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 ] ++ lib.flatten (lib.attrValues optional-dependencies);
61
62 pytestFlagsArray = [ "tests/unit" ];
63
64 # Deselect socket tests on Darwin because it hits the path length limit for a Unix domain socket
65 disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [
66 "api_test"
67 "stream_response"
68 "socket_file"
69 ];
70
71 meta = with lib; {
72 changelog = "https://github.com/docker/docker-py/releases/tag/${version}";
73 description = "API client for docker written in Python";
74 homepage = "https://github.com/docker/docker-py";
75 license = licenses.asl20;
76 maintainers = [ ];
77 };
78}