1{ lib
2, buildPythonPackage
3, fetchPypi
4, ddt
5, debtcollector
6, eventlet
7, fixtures
8, iso8601
9, netaddr
10, netifaces
11, oslo-i18n
12, oslotest
13, packaging
14, pbr
15, pyparsing
16, pytz
17, stestr
18, testscenarios
19, pyyaml
20, iana-etc
21, libredirect
22}:
23
24buildPythonPackage rec {
25 pname = "oslo-utils";
26 version = "6.0.1";
27
28 src = fetchPypi {
29 pname = "oslo.utils";
30 inherit version;
31 sha256 = "sha256-mwRU+ZQV0MqsXIYFNxbXRtGY7Oxm5nLY5eY4a2+6orY=";
32 };
33
34 postPatch = ''
35 # only a small portion of the listed packages are actually needed for running the tests
36 # so instead of removing them one by one remove everything
37 rm test-requirements.txt
38 '';
39
40 nativeBuildInputs = [ pbr ];
41
42 propagatedBuildInputs = [
43 debtcollector
44 iso8601
45 netaddr
46 netifaces
47 oslo-i18n
48 packaging
49 pyparsing
50 pytz
51 ];
52
53 checkInputs = [
54 ddt
55 eventlet
56 fixtures
57 oslotest
58 stestr
59 testscenarios
60 pyyaml
61 ];
62
63 checkPhase = ''
64 echo "nameserver 127.0.0.1" > resolv.conf
65 export NIX_REDIRECTS=/etc/protocols=${iana-etc}/etc/protocols:/etc/resolv.conf=$(realpath resolv.conf)
66 export LD_PRELOAD=${libredirect}/lib/libredirect.so
67
68 stestr run
69 '';
70
71 pythonImportsCheck = [ "oslo_utils" ];
72
73 meta = with lib; {
74 description = "Oslo Utility library";
75 homepage = "https://github.com/openstack/oslo.utils";
76 license = licenses.asl20;
77 maintainers = teams.openstack.members;
78 };
79}