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