Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / oslo-concurrency / default.nix
blob13fbdbcaac64affe40a311190fe802628776d95a
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 = "6.0.0";
22   format = "setuptools";
24   src = fetchPypi {
25     pname = "oslo.concurrency";
26     inherit version;
27     hash = "sha256-tS8CtORvXydLkfuOG/xcv5pBjfzUqDvggDRUlePSboo=";
28   };
30   postPatch = ''
31     # only a small portion of the listed packages are actually needed for running the tests
32     # so instead of removing them one by one remove everything
33     rm test-requirements.txt
35     substituteInPlace oslo_concurrency/tests/unit/test_processutils.py \
36       --replace "/bin/bash" "${bash}/bin/bash" \
37       --replace "/bin/true" "${coreutils}/bin/true" \
38       --replace "/usr/bin/env" "${coreutils}/bin/env" \
39       --replace "/usr/bin/true" "${coreutils}/bin/true"
40   '';
42   propagatedBuildInputs = [
43     fasteners
44     oslo-config
45     oslo-utils
46     pbr
47   ];
49   # tests hang for unknown reason and time the build out
50   doCheck = false;
52   nativeCheckInputs = [
53     eventlet
54     fixtures
55     oslotest
56     stestr
57   ];
59   checkPhase = ''
60     echo "nameserver 127.0.0.1" > resolv.conf
61     export NIX_REDIRECTS=/etc/protocols=${iana-etc}/etc/protocols:/etc/resolv.conf=$(realpath resolv.conf)
62     export LD_PRELOAD=${libredirect}/lib/libredirect.so
64     stestr run -e <(echo "
65     oslo_concurrency.tests.unit.test_lockutils_eventlet.TestInternalLock.test_fair_lock_with_spawn
66     oslo_concurrency.tests.unit.test_lockutils_eventlet.TestInternalLock.test_fair_lock_with_spawn_n
67     ")
68   '';
70   pythonImportsCheck = [ "oslo_concurrency" ];
72   meta = with lib; {
73     broken = stdenv.isDarwin;
74     description = "Oslo Concurrency library";
75     mainProgram = "lockutils-wrapper";
76     homepage = "https://github.com/openstack/oslo.concurrency";
77     license = licenses.asl20;
78     maintainers = teams.openstack.members;
79   };