summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/pycobertura/default.nix
blob: e509a825dbf18ebbca5ebe20f6d1476a72443528 (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
67
68
69
70
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  setuptools,
  setuptools-git,
  click,
  jinja2,
  lxml,
  tabulate,
  ruamel-yaml,
  pytestCheckHook,
  mock,
}:

buildPythonPackage rec {
  pname = "pycobertura";
  version = "4.1.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "aconrad";
    repo = "pycobertura";
    tag = "v${version}";
    hash = "sha256-OzOxoF3OmgtzWuNNyecyxFRcPq8gAPQZ2XAdrkJjnhk=";
  };

  postPatch = ''
    # Remove build-system requirements as we handle them through Nix
    sed -i '/\[build-system\]/,/build-backend/d' pyproject.toml
  '';

  build-system = [
    setuptools
    setuptools-git
  ];

  dependencies = [
    click
    jinja2
    lxml
    tabulate
    ruamel-yaml
  ];

  nativeCheckInputs = [
    pytestCheckHook
    mock
  ];

  disabledTests = [
    # Tests require git and a git repository
    "test_filesystem_git_integration"
    "test_filesystem_git_integration__not_found"
    "test_filesystem_git_has_file_integration"
    "test_filesystem_git_has_file_integration__not_found"
    "test_filesystem_factory"
  ];

  pythonImportsCheck = [ "pycobertura" ];

  meta = {
    description = "Cobertura coverage parser that can diff reports and show coverage progress";
    homepage = "https://github.com/aconrad/pycobertura";
    changelog = "https://github.com/aconrad/pycobertura/blob/${version}/CHANGES.md";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ lovesegfault ];
    mainProgram = "pycobertura";
  };
}