1{ 2 lib, 3 stdenv, 4 buildPythonPackage, 5 fetchPypi, 6 mock, 7 pbr, 8 pyyaml, 9 setuptools, 10 six, 11 multi-key-dict, 12 testscenarios, 13 requests, 14 requests-mock, 15 stestr, 16 multiprocess, 17 pythonRelaxDepsHook, 18}: 19 20buildPythonPackage rec { 21 pname = "python-jenkins"; 22 version = "1.8.2"; 23 format = "setuptools"; 24 25 src = fetchPypi { 26 inherit pname version; 27 hash = "sha256-VufauwYHvbjh1vxtLUMBq+2+2RZdorIG+svTBxy27ss="; 28 }; 29 30 # test uses timeout mechanism unsafe for use with the "spawn" 31 # multiprocessing backend used on macos 32 postPatch = lib.optionalString stdenv.isDarwin '' 33 substituteInPlace tests/test_jenkins_sockets.py \ 34 --replace test_jenkins_open_no_timeout dont_test_jenkins_open_no_timeout 35 ''; 36 37 nativeBuildInputs = [ pythonRelaxDepsHook ]; 38 pythonRelaxDeps = [ "setuptools" ]; 39 40 buildInputs = [ mock ]; 41 propagatedBuildInputs = [ 42 pbr 43 pyyaml 44 setuptools 45 six 46 multi-key-dict 47 requests 48 ]; 49 50 __darwinAllowLocalNetworking = true; 51 52 nativeCheckInputs = [ 53 stestr 54 testscenarios 55 requests-mock 56 multiprocess 57 ]; 58 checkPhase = '' 59 # Skip tests that fail due to setuptools>=66.0.0 rejecting PEP 440 60 # non-conforming versions. See 61 # https://github.com/pypa/setuptools/issues/2497 for details. 62 stestr run -E "tests.test_plugins.(PluginsTestScenarios.test_plugin_version_comparison|PluginsTestScenarios.test_plugin_version_object_comparison|PluginsTest.test_plugin_equal|PluginsTest.test_plugin_not_equal)" 63 ''; 64 65 meta = with lib; { 66 description = "Python bindings for the remote Jenkins API"; 67 homepage = "https://pypi.python.org/pypi/python-jenkins"; 68 license = licenses.bsd3; 69 maintainers = with maintainers; [ gador ]; 70 }; 71}