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