2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
|
|
|
ddt,
|
|
|
|
debtcollector,
|
|
|
|
eventlet,
|
|
|
|
fixtures,
|
|
|
|
iso8601,
|
|
|
|
netaddr,
|
|
|
|
netifaces,
|
|
|
|
oslo-i18n,
|
|
|
|
oslotest,
|
|
|
|
packaging,
|
|
|
|
pbr,
|
|
|
|
pyparsing,
|
|
|
|
pytz,
|
2024-09-19 14:19:46 +00:00
|
|
|
qemu,
|
2024-06-05 15:53:02 +00:00
|
|
|
setuptools,
|
|
|
|
stestr,
|
|
|
|
testscenarios,
|
|
|
|
tzdata,
|
|
|
|
pyyaml,
|
|
|
|
iana-etc,
|
|
|
|
libredirect,
|
2021-09-18 10:52:07 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "oslo-utils";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "7.3.0";
|
2024-01-13 08:15:51 +00:00
|
|
|
pyproject = true;
|
2021-09-18 10:52:07 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
pname = "oslo.utils";
|
|
|
|
inherit version;
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-WaXT5Oe7x42AHM68K4I+QptiTBK7bjtudvccKfK/Id8=";
|
2021-09-18 10:52:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pbr
|
|
|
|
setuptools
|
|
|
|
];
|
2021-09-18 10:52:07 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
debtcollector
|
|
|
|
iso8601
|
|
|
|
netaddr
|
|
|
|
netifaces
|
|
|
|
oslo-i18n
|
|
|
|
packaging
|
|
|
|
pyparsing
|
|
|
|
pytz
|
2024-01-13 08:15:51 +00:00
|
|
|
tzdata
|
2021-09-18 10:52:07 +00:00
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-09-18 10:52:07 +00:00
|
|
|
ddt
|
|
|
|
eventlet
|
|
|
|
fixtures
|
|
|
|
oslotest
|
2024-09-19 14:19:46 +00:00
|
|
|
qemu
|
2021-09-18 10:52:07 +00:00
|
|
|
stestr
|
|
|
|
testscenarios
|
|
|
|
pyyaml
|
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
# disabled tests:
|
|
|
|
# https://bugs.launchpad.net/oslo.utils/+bug/2054134
|
|
|
|
# netaddr default behaviour changed to be stricter
|
2024-06-05 15:53:02 +00:00
|
|
|
checkPhase = ''
|
2021-09-18 10:52:07 +00:00
|
|
|
echo "nameserver 127.0.0.1" > resolv.conf
|
|
|
|
export NIX_REDIRECTS=/etc/protocols=${iana-etc}/etc/protocols:/etc/resolv.conf=$(realpath resolv.conf)
|
|
|
|
export LD_PRELOAD=${libredirect}/lib/libredirect.so
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
stestr run -e <(echo "
|
|
|
|
oslo_utils.tests.test_netutils.NetworkUtilsTest.test_is_valid_ip
|
|
|
|
oslo_utils.tests.test_netutils.NetworkUtilsTest.test_is_valid_ipv4
|
|
|
|
")
|
2021-09-18 10:52:07 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "oslo_utils" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Oslo Utility library";
|
|
|
|
homepage = "https://github.com/openstack/oslo.utils";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = teams.openstack.members;
|
|
|
|
};
|
|
|
|
}
|