Unverified Commit 68ab8e80 authored by OTABI Tomoya's avatar OTABI Tomoya Committed by GitHub
Browse files

Merge pull request #227869 from traxys/fit-trackee

fit-trackee: init at 0.7.15
parents 2cb8276e 9478a7ef
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 ];
  };
}
+85 −0
Original line number Diff line number Diff line
{ lib
, buildPythonPackage
, pythonOlder
, fetchFromGitLab
, poetry-core
, dramatiq
, flask
, requests
, pytestCheckHook
, flask-migrate
, periodiq
, postgresql
, postgresqlTestHook
, psycopg2
}:

buildPythonPackage {
  pname = "flask-dramatiq";
  version = "0.6.0";
  format = "pyproject";

  disabled = pythonOlder "3.6";

  src = fetchFromGitLab {
    owner = "bersace";
    repo = "flask-dramatiq";
    rev = "840209e9bf582b4dda468e8bba515f248f3f8534";
    hash = "sha256-qjV1zyVzHPXMt+oUeGBdP9XVlbcSz2MF9Zygj543T4w=";
  };

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace 'poetry>=0.12' 'poetry-core' \
      --replace 'poetry.masonry.api' 'poetry.core.masonry.api'

    patchShebangs --build ./example.py

    sed -i ./tests/unit/pytest.ini \
      -e 's:--cov=flask_dramatiq::' \
      -e 's:--cov-report=term-missing::'
  '';

  nativeBuildInputs = [
    poetry-core
  ];

  propagatedBuildInputs = [
    dramatiq
  ];

  nativeCheckInputs = [
    pytestCheckHook
    flask
    requests
    flask-migrate
    periodiq
    postgresql
    postgresqlTestHook
    psycopg2
  ] ++ dramatiq.optional-dependencies.rabbitmq;

  postgresqlTestSetupPost = ''
    substituteInPlace config.py \
      --replace 'SQLALCHEMY_DATABASE_URI = f"postgresql://{PGUSER}:{PGPASSWORD}@{PGHOST}/{PGDATABASE}"' \
        "SQLALCHEMY_DATABASE_URI = \"postgresql://$PGUSER/$PGDATABASE?host=$PGHOST\""
    python3 ./example.py db upgrade
  '';

  pytestFlagsArray = [ "-x" "tests/func/" "tests/unit"];

  pythonImportsCheck = [ "flask_dramatiq" ];

  # Does HTTP requests to localhost
  disabledTests = [
    "test_fast"
    "test_other"
  ];

  meta = with lib; {
    description = "Adds Dramatiq support to your Flask application";
    homepage = "https://gitlab.com/bersace/flask-dramatiq";
    license = licenses.bsd3;
    maintainers = with maintainers; [ traxys ];
  };
}
+55 −0
Original line number Diff line number Diff line
{ lib
, buildPythonPackage
, pythonOlder
, fetchFromGitLab
, poetry-core
, dramatiq
, pendulum
, setuptools
, pytest-mock
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "periodiq";
  version = "0.12.1";
  format = "pyproject";

  disabled = pythonOlder "3.5";

  src = fetchFromGitLab {
    owner = "bersace";
    repo = "periodiq";
    rev = "v${version}";
    hash = "sha256-Ar0n+Wi1OUtRdhVxrU7Nz4je8ylaHgPZbXE0a30hzU0=";
  };

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace 'poetry>=0.12' 'poetry-core' \
      --replace 'poetry.masonry.api' 'poetry.core.masonry.api'
  '';

  nativeBuildInputs = [
    poetry-core
  ];

  propagatedBuildInputs = [
    dramatiq
    pendulum
    setuptools
  ];

  nativeCheckInputs = [ pytestCheckHook pytest-mock ];

  pytestFlagsArray = [ "tests/unit" ];

  pythonImportsCheck = [ "periodiq" ];

  meta = with lib; {
    description = "Simple Scheduler for Dramatiq Task Queue";
    homepage = "https://pypi.org/project/periodiq/";
    license = licenses.lgpl3Only;
    maintainers = with maintainers; [ traxys ];
  };
}
+31 −0
Original line number Diff line number Diff line
{ lib
, buildPythonPackage
, fetchPypi
, pillow
, requests
}:

buildPythonPackage rec {
  pname = "staticmap";
  version = "0.5.7";
  format = "setuptools";

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-x6lrkCumEpLoGMILCBBhnWuBps21C8wauS1QrE2yCn8=";
  };

  propagatedBuildInputs = [ requests pillow ];

  pythonImportsCheck = [ "staticmap" ];

  # Tests seem to be broken
  doCheck = false;

  meta = with lib; {
    description = "A small, python-based library for creating map images with lines and markers";
    homepage = "https://pypi.org/project/staticmap/";
    license = with licenses; [ asl20 ];
    maintainers = with maintainers; [ traxys ];
  };
}
+40 −0
Original line number Diff line number Diff line
{ lib
, buildPythonPackage
, fetchFromGitHub
, gevent
, pytestCheckHook
, watchdog
}:

buildPythonPackage rec {
  pname = "watchdog-gevent";
  version = "0.1.1";
  format = "setuptools";

  # Need to fetch from github because tests are not present in pypi
  src = fetchFromGitHub {
    owner = "Bogdanp";
    repo = "watchdog_gevent";
    rev = "v${version}";
    hash = "sha256-FESm3fNuLmOg2ilI/x8U9LuAimHLnahcTHYzW/nzOVY=";
  };

  propagatedBuildInputs = [ watchdog gevent ];

  postPatch = ''
    sed -i setup.cfg \
      -e 's:--cov watchdog_gevent::' \
      -e 's:--cov-report html::'
  '';

  nativeCheckInputs = [ pytestCheckHook ];

  pythonImportsCheck = [ "watchdog_gevent" ];

  meta = with lib; {
    description = "A gevent-based observer for watchdog";
    homepage = "https://github.com/Bogdanp/watchdog_gevent";
    license = licenses.asl20;
    maintainers = with maintainers; [ traxys ];
  };
}
Loading