ansible-later: 2.0.22 -> 2.0.23
[NixPkgs.git] / pkgs / development / python-modules / oslo-concurrency / default.nix
blob8a4d5926823e6fcaf2206d3b0133cc3601306f0f
1 { stdenv
2 , lib
3 , buildPythonPackage
4 , fetchPypi
5 , bash
6 , coreutils
7 , eventlet
8 , fasteners
9 , fixtures
10 , iana-etc
11 , libredirect
12 , oslo-config
13 , oslo-utils
14 , oslotest
15 , pbr
16 , stestr
19 buildPythonPackage rec {
20   pname = "oslo-concurrency";
21   version = "5.0.1";
23   src = fetchPypi {
24     pname = "oslo.concurrency";
25     inherit version;
26     sha256 = "sha256-DfvzYJX0Y3/7tl5cJB9MJYUavTtyjd2tnwc5YwKnJUQ=";
27   };
29   postPatch = ''
30     # only a small portion of the listed packages are actually needed for running the tests
31     # so instead of removing them one by one remove everything
32     rm test-requirements.txt
34     substituteInPlace oslo_concurrency/tests/unit/test_processutils.py \
35       --replace "/bin/bash" "${bash}/bin/bash" \
36       --replace "/bin/true" "${coreutils}/bin/true" \
37       --replace "/usr/bin/env" "${coreutils}/bin/env" \
38       --replace "/usr/bin/true" "${coreutils}/bin/true"
39   '';
41   propagatedBuildInputs = [
42     fasteners
43     oslo-config
44     oslo-utils
45     pbr
46   ];
48   # tests hang for unknown reason and time the build out
49   doCheck = false;
51   checkInputs = [
52     eventlet
53     fixtures
54     oslotest
55     stestr
56   ];
58   checkPhase = ''
59     echo "nameserver 127.0.0.1" > resolv.conf
60     export NIX_REDIRECTS=/etc/protocols=${iana-etc}/etc/protocols:/etc/resolv.conf=$(realpath resolv.conf)
61     export LD_PRELOAD=${libredirect}/lib/libredirect.so
63     stestr run -e <(echo "
64     oslo_concurrency.tests.unit.test_lockutils_eventlet.TestInternalLock.test_fair_lock_with_spawn
65     oslo_concurrency.tests.unit.test_lockutils_eventlet.TestInternalLock.test_fair_lock_with_spawn_n
66     ")
67   '';
69   pythonImportsCheck = [ "oslo_concurrency" ];
71   meta = with lib; {
72     broken = stdenv.isDarwin;
73     description = "Oslo Concurrency library";
74     homepage = "https://github.com/openstack/oslo.concurrency";
75     license = licenses.asl20;
76     maintainers = teams.openstack.members;
77   };