2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
2021-05-20 23:08:51 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, gevent
|
2022-08-12 12:06:08 +00:00
|
|
|
, nose2
|
2020-04-24 23:36:52 +00:00
|
|
|
, mock
|
|
|
|
, twisted
|
|
|
|
, tornado
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pika";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "1.3.2";
|
2022-08-12 12:06:08 +00:00
|
|
|
format = "pyproject";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pika";
|
|
|
|
repo = "pika";
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2023-05-24 13:37:59 +00:00
|
|
|
hash = "sha256-60Z+y3YXazUghfnOy4e7HzM18iju5m5OEt4I3Wg6ty4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
propagatedBuildInputs = [ gevent tornado twisted ];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ nose2 mock ];
|
2021-05-20 23:08:51 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# don't stop at first test failure
|
|
|
|
# don't run acceptance tests because they access the network
|
|
|
|
# don't report test coverage
|
2022-08-12 12:06:08 +00:00
|
|
|
substituteInPlace nose2.cfg \
|
2021-05-20 23:08:51 +00:00
|
|
|
--replace "stop = 1" "stop = 0" \
|
|
|
|
--replace "tests=tests/unit,tests/acceptance" "tests=tests/unit" \
|
|
|
|
--replace "with-coverage = 1" "with-coverage = 0"
|
|
|
|
'';
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
doCheck = false; # tests require rabbitmq instance, unsure how to skip
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
PIKA_TEST_TLS=true nose2 -v
|
2021-05-20 23:08:51 +00:00
|
|
|
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Pure-Python implementation of the AMQP 0-9-1 protocol";
|
|
|
|
homepage = "https://pika.readthedocs.org";
|
|
|
|
license = licenses.bsd3;
|
2022-08-12 12:06:08 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|