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}: 18 19buildPythonPackage rec { 20 pname = "python-jenkins"; 21 version = "1.8.3"; 22 format = "setuptools"; 23 24 src = fetchPypi { 25 pname = "python_jenkins"; 26 inherit version; 27 hash = "sha256-j0dhw5GsEejB8j93EBCSDBBEBJdwWrcXXVI1j1oS3Jg="; 28 }; 29 30 # test uses timeout mechanism unsafe for use with the "spawn" 31 # multiprocessing backend used on macos 32 postPatch = lib.optionalString stdenv.hostPlatform.isDarwin '' 33 substituteInPlace tests/test_jenkins_sockets.py \ 34 --replace test_jenkins_open_no_timeout dont_test_jenkins_open_no_timeout 35 ''; 36 37 pythonRelaxDeps = [ "setuptools" ]; 38 39 buildInputs = [ mock ]; 40 propagatedBuildInputs = [ 41 pbr 42 pyyaml 43 setuptools 44 six 45 multi-key-dict 46 requests 47 ]; 48 49 __darwinAllowLocalNetworking = true; 50 51 nativeCheckInputs = [ 52 stestr 53 testscenarios 54 requests-mock 55 multiprocess 56 ]; 57 checkPhase = '' 58 # Skip tests that fail due to setuptools>=66.0.0 rejecting PEP 440 59 # non-conforming versions. See 60 # https://github.com/pypa/setuptools/issues/2497 for details. 61 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)" 62 ''; 63 64 meta = with lib; { 65 description = "Python bindings for the remote Jenkins API"; 66 homepage = "https://pypi.python.org/pypi/python-jenkins"; 67 license = licenses.bsd3; 68 maintainers = with maintainers; [ gador ]; 69 }; 70}