summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/pytest-celery/default.nix
blob: e7fc01702e93fb82c0a77db33913a5884b430fe3 (plain)
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
57
58
59
60
61
62
63
64
65
66
{
  lib,
  buildPythonPackage,
  celery,
  debugpy,
  docker,
  fetchFromGitHub,
  kombu,
  poetry-core,
  psutil,
  pytest-docker-tools,
  pytest,
  tenacity,
}:

buildPythonPackage rec {
  pname = "pytest-celery";
  version = "1.2.1";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "celery";
    repo = "pytest-celery";
    tag = "v${version}";
    hash = "sha256-E8GO/00IC9kUvQLZmTFaK4FFQ7d+/tw/kVTQbAqRRRM=";
  };

  postPatch = ''
    # Avoid infinite recursion with celery
    substituteInPlace pyproject.toml \
      --replace 'celery = { version = "*" }' ""
  '';

  pythonRelaxDeps = [
    "debugpy"
  ];

  pythonRemoveDeps = [
    "celery" # cyclic dependency
    "setuptools" # https://github.com/celery/pytest-celery/pull/464
  ];

  build-system = [ poetry-core ];

  buildInputs = [ pytest ];

  dependencies = [
    debugpy
    docker
    kombu
    psutil
    pytest-docker-tools
    tenacity
  ];

  # Infinite recursion with celery
  doCheck = false;

  meta = {
    description = "Pytest plugin to enable celery.contrib.pytest";
    homepage = "https://github.com/celery/pytest-celery";
    changelog = "https://github.com/celery/pytest-celery/blob/${src.tag}/Changelog.rst";
    license = lib.licenses.mit;
    maintainers = [ ];
  };
}