about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/periodiq/default.nix
blob: 478168de30d04738053e5569c2bdbd9d11064943 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{ 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";
    mainProgram = "periodiq";
    homepage = "https://pypi.org/project/periodiq/";
    license = licenses.lgpl3Only;
    maintainers = with maintainers; [ traxys ];
  };
}