1{
2 lib,
3 stdenv,
4 adal,
5 buildPythonPackage,
6 certifi,
7 durationpy,
8 fetchFromGitHub,
9 google-auth,
10 mock,
11 pytestCheckHook,
12 python-dateutil,
13 pythonOlder,
14 pyyaml,
15 requests,
16 requests-oauthlib,
17 setuptools,
18 six,
19 urllib3,
20 websocket-client,
21}:
22
23buildPythonPackage rec {
24 pname = "kubernetes";
25 version = "33.1.0";
26 pyproject = true;
27
28 disabled = pythonOlder "3.6";
29
30 src = fetchFromGitHub {
31 owner = "kubernetes-client";
32 repo = "python";
33 tag = "v${version}";
34 hash = "sha256-+jL0XS7Y8qOqzZ5DcG/hZFUpj7krJAaA4fgPNSEgIAE=";
35 };
36
37 build-system = [
38 setuptools
39 ];
40
41 dependencies = [
42 certifi
43 durationpy
44 google-auth
45 python-dateutil
46 pyyaml
47 requests
48 requests-oauthlib
49 six
50 urllib3
51 websocket-client
52 ];
53
54 optional-dependencies = {
55 adal = [ adal ];
56 };
57
58 pythonImportsCheck = [ "kubernetes" ];
59
60 nativeCheckInputs = [
61 mock
62 pytestCheckHook
63 ]
64 ++ lib.flatten (builtins.attrValues optional-dependencies);
65
66 disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [
67 # AssertionError: <class 'urllib3.poolmanager.ProxyManager'> != <class 'urllib3.poolmanager.Poolmanager'>
68 "test_rest_proxycare"
69 ];
70
71 meta = with lib; {
72 description = "Kubernetes Python client";
73 homepage = "https://github.com/kubernetes-client/python";
74 changelog = "https://github.com/kubernetes-client/python/releases/tag/${src.tag}";
75 license = licenses.asl20;
76 maintainers = with maintainers; [ lsix ];
77 };
78}