summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/pytest-reraise/default.nix
blob: a55040017dd8ba33f7d39c1c3b811336fafce1dc (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
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  pytest,
  pytestCheckHook,
  poetry-core,
}:

buildPythonPackage rec {
  pname = "pytest-reraise";
  version = "2.1.2";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "bjoluc";
    repo = pname;
    tag = "v${version}";
    hash = "sha256-mgNKoZ+2sinArTZhSwhLxzBTb4QfiT1LWBs7w5MHXWA=";
  };

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

  build-system = [ poetry-core ];

  dependencies = [ pytest ];

  nativeCheckInputs = [ pytestCheckHook ];

  pythonImportsCheck = [ "pytest_reraise" ];

  meta = {
    description = "Make multi-threaded pytest test cases fail when they should";
    longDescription = ''
      Make multi-threaded pytest test cases fail when they should
    '';
    homepage = "https://github.com/bjoluc/pytest-reraise";
    changelog = "https://github.com/bjoluc/pytest-reraise/releases/tag/${src.tag}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ cpcloud ];
  };
}