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