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