1{ lib
2, stdenv
3, buildPythonPackage
4, fetchPypi
5, mock
6, pbr
7, pyyaml
8, setuptools
9, six
10, multi_key_dict
11, testscenarios
12, requests
13, requests-mock
14, stestr
15}:
16
17buildPythonPackage rec {
18 pname = "python-jenkins";
19 version = "1.7.0";
20
21 src = fetchPypi {
22 inherit pname version;
23 sha256 = "01jid5s09lr3kayr2h1z9n8h9nhyw3jxv9c4b5hrlxijknkqzvfy";
24 };
25
26 # test uses timeout mechanism unsafe for use with the "spawn"
27 # multiprocessing backend used on macos
28 postPatch = lib.optionalString stdenv.isDarwin ''
29 substituteInPlace tests/test_jenkins_sockets.py \
30 --replace test_jenkins_open_no_timeout dont_test_jenkins_open_no_timeout
31 '';
32
33 buildInputs = [ mock ];
34 propagatedBuildInputs = [ pbr pyyaml setuptools six multi_key_dict requests ];
35
36 checkInputs = [ stestr testscenarios requests-mock ];
37 checkPhase = ''
38 stestr run
39 '';
40
41 meta = with lib; {
42 description = "Python bindings for the remote Jenkins API";
43 homepage = "https://pypi.python.org/pypi/python-jenkins";
44 license = licenses.bsd3;
45 maintainers = with maintainers; [ gador ];
46 };
47
48}