1{ lib
2, buildPythonPackage
3, fetchPypi
4, bash
5, coreutils
6, eventlet
7, fasteners
8, fixtures
9, iana-etc
10, libredirect
11, oslo-config
12, oslo-utils
13, oslotest
14, pbr
15, stestr
16}:
17
18buildPythonPackage rec {
19 pname = "oslo-concurrency";
20 version = "4.5.0";
21
22 src = fetchPypi {
23 pname = "oslo.concurrency";
24 inherit version;
25 sha256 = "1h76pq9p1bpwcs6jl9m2w4280wcp2w3is88qlaqknqkd3pdaixwr";
26 };
27
28 postPatch = ''
29 # only a small portion of the listed packages are actually needed for running the tests
30 # so instead of removing them one by one remove everything
31 rm test-requirements.txt
32
33 substituteInPlace oslo_concurrency/tests/unit/test_processutils.py \
34 --replace "/bin/bash" "${bash}/bin/bash" \
35 --replace "/bin/true" "${coreutils}/bin/true" \
36 --replace "/usr/bin/env" "${coreutils}/bin/env" \
37 --replace "/usr/bin/true" "${coreutils}/bin/true"
38 '';
39
40 propagatedBuildInputs = [
41 fasteners
42 oslo-config
43 oslo-utils
44 pbr
45 ];
46
47 checkInputs = [
48 eventlet
49 fixtures
50 oslotest
51 stestr
52 ];
53
54 checkPhase = ''
55 echo "nameserver 127.0.0.1" > resolv.conf
56 export NIX_REDIRECTS=/etc/protocols=${iana-etc}/etc/protocols:/etc/resolv.conf=$(realpath resolv.conf)
57 export LD_PRELOAD=${libredirect}/lib/libredirect.so
58
59 stestr run
60 '';
61
62 pythonImportsCheck = [ "oslo_concurrency" ];
63
64 meta = with lib; {
65 description = "Oslo Concurrency library";
66 homepage = "https://github.com/openstack/oslo.concurrency";
67 license = licenses.asl20;
68 maintainers = teams.openstack.members;
69 };
70}