@@ -0,0 +1,38 @@
1+{ stdenv, buildPythonPackage, fetchPypi, pythonAtLeast,
2+ ipaddress, websocket_client, urllib3, pyyaml, requests_oauthlib, python-dateutil, google_auth,
3+ isort, pytest, coverage, mock, sphinx, autopep8, pep8, codecov, recommonmark, nose }:
4+
5+buildPythonPackage rec {
6+ pname = "kubernetes";
7+ version = "5.0.0";
8+
9+ prePatch = ''
10+ sed -e 's/sphinx>=1.2.1,!=1.3b1,<1.4 # BSD/sphinx/' -i test-requirements.txt
11+
12+ # This is used to randomize tests, which is not reproducible. Drop it.
13+ sed -e '/randomize/d' -i test-requirements.txt
14+ ''
15+ # This is a python2 and python3.2 only requiremet since it is a backport of a python-3.3 api.
16+ + (if (pythonAtLeast "3.3") then ''
17+ sed -e '/ipaddress/d' -i requirements.txt
18+ '' else "");
19+
20+ checkPhase = ''
21+ py.test
22+ '';
23+
24+ src = fetchPypi {
25+ inherit pname version;
26+ sha256 = "1z8rrlq73bzli9rg57kj8ivz09vhsydyjq1ksbcis6j7h9c187zq";
27+ };
28+
29+ checkInputs = [ isort coverage pytest mock sphinx autopep8 pep8 codecov recommonmark nose ];
30+ propagatedBuildInputs = [ ipaddress websocket_client urllib3 pyyaml requests_oauthlib python-dateutil google_auth ];
31+
32+ meta = with stdenv.lib; {
33+ description = "Kubernetes python client";
34+ homepage = https://github.com/kubernetes-client/python;
35+ license = licenses.asl20;
36+ maintainers = with maintainers; [ lsix ];
37+ };
38+}