Commit 5e3fc68f authored by traxys's avatar traxys
Browse files

python310Packages.dramatiq: init at 1.14.2

parent 548e9790
Loading
Loading
Loading
Loading
+106 −0
Original line number Diff line number Diff line
{ lib
, stdenv
, buildPythonPackage
, pythonOlder
, fetchFromGitHub
, gevent
, pika
, prometheus-client
, pylibmc
, pytestCheckHook
, redis
, watchdog
, watchdog-gevent
}:

buildPythonPackage rec {
  pname = "dramatiq";
  version = "1.14.2";
  format = "setuptools";

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "Bogdanp";
    repo = "dramatiq";
    rev = "v${version}";
    hash = "sha256-yv6HUJI7wsAQdBJ5QNv7qXhtzPvCsrF1389kyemAV7Y=";
  };

  propagatedBuildInputs = [
    prometheus-client
  ];

  passthru.optional-dependencies = {
    all = [
      gevent
      pika
      pylibmc
      redis
      watchdog
      watchdog-gevent
    ];
    gevent = [
      gevent
    ];
    memcached = [
      pylibmc
    ];
    rabbitmq = [
      pika
    ];
    redis = [
      redis
    ];
    watch = [
      watchdog
      watchdog-gevent
    ];
  };

  nativeCheckInputs = [ pytestCheckHook pika redis pylibmc ];

  postPatch = ''
    sed -i ./setup.cfg \
      -e 's:--cov dramatiq::' \
      -e 's:--cov-report html::' \
      -e 's:--benchmark-autosave::' \
      -e 's:--benchmark-compare::' \
  '';

  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"
  ];

  pythonImportsCheck = [ "dramatiq" ];

  meta = with lib; {
    description = "Background Processing for Python 3";
    homepage = "https://github.com/Bogdanp/dramatiq";
    license = licenses.gpl3Only;
    maintainers = with maintainers; [ traxys ];
  };
}
+2 −0
Original line number Diff line number Diff line
@@ -3244,6 +3244,8 @@ self: super: with self; {
  dragonfly = callPackage ../development/python-modules/dragonfly { };
  dramatiq = callPackage ../development/python-modules/dramatiq { };
  drawille = callPackage ../development/python-modules/drawille { };
  drawilleplot = callPackage ../development/python-modules/drawilleplot { };