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