2022-06-16 17:23:12 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2021-09-18 10:52:07 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, bash
|
|
|
|
, coreutils
|
|
|
|
, eventlet
|
|
|
|
, fasteners
|
|
|
|
, fixtures
|
|
|
|
, iana-etc
|
|
|
|
, libredirect
|
|
|
|
, oslo-config
|
|
|
|
, oslo-utils
|
|
|
|
, oslotest
|
|
|
|
, pbr
|
|
|
|
, stestr
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "oslo-concurrency";
|
2023-03-15 16:39:30 +00:00
|
|
|
version = "5.1.1";
|
2021-09-18 10:52:07 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
pname = "oslo.concurrency";
|
|
|
|
inherit version;
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-EQ+2Adgi3UsI7qJ5d9cNAfnxzR6vbezQQqIfQ78/KyU=";
|
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
|
|
|
|
|
|
|
|
substituteInPlace oslo_concurrency/tests/unit/test_processutils.py \
|
|
|
|
--replace "/bin/bash" "${bash}/bin/bash" \
|
|
|
|
--replace "/bin/true" "${coreutils}/bin/true" \
|
|
|
|
--replace "/usr/bin/env" "${coreutils}/bin/env" \
|
|
|
|
--replace "/usr/bin/true" "${coreutils}/bin/true"
|
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
fasteners
|
|
|
|
oslo-config
|
|
|
|
oslo-utils
|
|
|
|
pbr
|
|
|
|
];
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
# tests hang for unknown reason and time the build out
|
|
|
|
doCheck = false;
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-09-18 10:52:07 +00:00
|
|
|
eventlet
|
|
|
|
fixtures
|
|
|
|
oslotest
|
|
|
|
stestr
|
|
|
|
];
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
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
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
stestr run -e <(echo "
|
|
|
|
oslo_concurrency.tests.unit.test_lockutils_eventlet.TestInternalLock.test_fair_lock_with_spawn
|
|
|
|
oslo_concurrency.tests.unit.test_lockutils_eventlet.TestInternalLock.test_fair_lock_with_spawn_n
|
|
|
|
")
|
2021-09-18 10:52:07 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "oslo_concurrency" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
2022-06-16 17:23:12 +00:00
|
|
|
broken = stdenv.isDarwin;
|
2021-09-18 10:52:07 +00:00
|
|
|
description = "Oslo Concurrency library";
|
|
|
|
homepage = "https://github.com/openstack/oslo.concurrency";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = teams.openstack.members;
|
|
|
|
};
|
|
|
|
}
|