1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
|
{
lib,
buildPythonPackage,
fetchPypi,
# build-system
pbr,
setuptools,
# dependencies
debtcollector,
iso8601,
netaddr,
netifaces,
oslo-i18n,
packaging,
psutil,
pyparsing,
pytz,
tzdata,
# tests
ddt,
eventlet,
fixtures,
iana-etc,
libredirect,
libxcrypt-legacy,
oslotest,
pyyaml,
qemu-utils,
replaceVars,
stdenv,
stestr,
testscenarios,
}:
buildPythonPackage rec {
pname = "oslo-utils";
version = "9.1.0";
pyproject = true;
src = fetchPypi {
pname = "oslo_utils";
inherit version;
hash = "sha256-AcOHXnzKAFtZRlxCn0ZxE7X0sEIRy9U0yawvFSJ207M=";
};
patches = [
(replaceVars ./ctypes.patch {
crypt = "${lib.getLib libxcrypt-legacy}/lib/libcrypt${stdenv.hostPlatform.extensions.sharedLibrary}";
})
];
postPatch = ''
# only a small portion of the listed packages are actually needed for running the tests
# so instead of removing them one by one remove everything
rm test-requirements.txt
'';
build-system = [
pbr
setuptools
];
dependencies = [
debtcollector
iso8601
netaddr
netifaces
oslo-i18n
packaging
psutil
pyparsing
pytz
tzdata
];
nativeCheckInputs = [
ddt
eventlet
fixtures
libredirect.hook
oslotest
pyyaml
qemu-utils
stestr
testscenarios
];
# disabled tests:
# https://bugs.launchpad.net/oslo.utils/+bug/2054134
# netaddr default behaviour changed to be stricter
checkPhase = ''
echo "nameserver 127.0.0.1" > resolv.conf
export NIX_REDIRECTS=/etc/protocols=${iana-etc}/etc/protocols:/etc/resolv.conf=$(realpath resolv.conf)
stestr run -e <(echo "
oslo_utils.tests.test_netutils.NetworkUtilsTest.test_is_valid_ip
oslo_utils.tests.test_netutils.NetworkUtilsTest.test_is_valid_ipv4
oslo_utils.tests.test_eventletutils.EventletUtilsTest.test_event_set_clear_timeout
")
'';
pythonImportsCheck = [ "oslo_utils" ];
meta = {
description = "Oslo Utility library";
homepage = "https://github.com/openstack/oslo.utils";
license = lib.licenses.asl20;
teams = [ lib.teams.openstack ];
};
}
|