2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
|
|
|
pythonOlder,
|
|
|
|
fetchFromGitHub,
|
|
|
|
gevent,
|
|
|
|
pika,
|
|
|
|
prometheus-client,
|
|
|
|
pylibmc,
|
|
|
|
pytestCheckHook,
|
|
|
|
redis,
|
|
|
|
watchdog,
|
|
|
|
watchdog-gevent,
|
2023-11-16 04:20:00 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "dramatiq";
|
2024-06-05 15:53:02 +00:00
|
|
|
version = "1.17.0";
|
2023-11-16 04:20:00 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Bogdanp";
|
|
|
|
repo = "dramatiq";
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-06-05 15:53:02 +00:00
|
|
|
hash = "sha256-xKHTBo2AirxDXe/CLSqo++3AgxP4pVkGTNdgS5CCZ3c=";
|
2023-11-16 04:20:00 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs = [ prometheus-client ];
|
2023-11-16 04:20:00 +00:00
|
|
|
|
|
|
|
passthru.optional-dependencies = {
|
|
|
|
all = [
|
|
|
|
gevent
|
|
|
|
pika
|
|
|
|
pylibmc
|
|
|
|
redis
|
|
|
|
watchdog
|
|
|
|
watchdog-gevent
|
|
|
|
];
|
2024-06-05 15:53:02 +00:00
|
|
|
gevent = [ gevent ];
|
|
|
|
memcached = [ pylibmc ];
|
|
|
|
rabbitmq = [ pika ];
|
|
|
|
redis = [ redis ];
|
2023-11-16 04:20:00 +00:00
|
|
|
watch = [
|
|
|
|
watchdog
|
|
|
|
watchdog-gevent
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
pika
|
|
|
|
redis
|
|
|
|
pylibmc
|
|
|
|
];
|
2023-11-16 04:20:00 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed -i ./setup.cfg \
|
|
|
|
-e 's:--cov dramatiq::' \
|
|
|
|
-e 's:--cov-report html::' \
|
|
|
|
-e 's:--benchmark-autosave::' \
|
|
|
|
-e 's:--benchmark-compare::' \
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
disabledTests =
|
|
|
|
[
|
|
|
|
# Requires a running redis
|
|
|
|
"test_after_process_boot_call_has_no_blocked_signals"
|
|
|
|
"test_cli_can_be_reloaded_on_sighup"
|
|
|
|
"test_cli_can_watch_for_source_code_changes"
|
|
|
|
"test_cli_fork_functions_have_no_blocked_signals"
|
|
|
|
"test_consumer_threads_have_no_blocked_signals"
|
|
|
|
"test_middleware_fork_functions_have_no_blocked_signals"
|
|
|
|
"test_redis_broker_can_connect_via_client"
|
|
|
|
"test_redis_broker_can_connect_via_url"
|
|
|
|
"test_redis_process_100k_messages_with_cli"
|
|
|
|
"test_redis_process_10k_fib_with_cli"
|
|
|
|
"test_redis_process_1k_latency_with_cli"
|
|
|
|
"test_worker_threads_have_no_blocked_signals"
|
|
|
|
# Requires a running rabbitmq
|
|
|
|
"test_rabbitmq_broker_can_be_passed_a_list_of_parameters_for_failover"
|
|
|
|
"test_rabbitmq_broker_can_be_passed_a_list_of_uri_for_failover"
|
|
|
|
"test_rabbitmq_broker_can_be_passed_a_semicolon_separated_list_of_uris"
|
|
|
|
"test_rabbitmq_broker_connections_are_lazy"
|
|
|
|
"test_rabbitmq_process_100k_messages_with_cli"
|
|
|
|
"test_rabbitmq_process_10k_fib_with_cli"
|
|
|
|
"test_rabbitmq_process_1k_latency_with_cli"
|
|
|
|
]
|
|
|
|
++ lib.optionals stdenv.isDarwin [
|
|
|
|
# Takes too long for darwin ofborg
|
|
|
|
"test_retry_exceptions_can_specify_a_delay"
|
|
|
|
];
|
2023-11-16 04:20:00 +00:00
|
|
|
|
|
|
|
pythonImportsCheck = [ "dramatiq" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Background Processing for Python 3";
|
|
|
|
homepage = "https://github.com/Bogdanp/dramatiq";
|
|
|
|
license = licenses.gpl3Only;
|
|
|
|
maintainers = with maintainers; [ traxys ];
|
|
|
|
};
|
|
|
|
}
|