summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/canmatrix/default.nix
blob: b52d7ceb7afb7ad6a4fe69c03a49e4ed602a633d (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
71
72
73
74
75
76
77
78
79
80
{
  lib,
  attrs,
  buildPythonPackage,
  click,
  fetchFromGitHub,
  ldfparser,
  lxml,
  openpyxl,
  pytest-cov-stub,
  pytest-timeout,
  pytestCheckHook,
  pyyaml,
  setuptools,
  xlrd,
  xlwt,
}:

buildPythonPackage rec {
  pname = "canmatrix";
  version = "1.2";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "ebroecker";
    repo = "canmatrix";
    tag = version;
    hash = "sha256-PfegsFha7ernSqnMeaDoLf1jLx1CiOoiYi34dESEgBY=";
  };

  build-system = [ setuptools ];

  dependencies = [
    attrs
    click
  ];

  optional-dependencies = {
    arxml = [ lxml ];
    fibex = [ lxml ];
    kcd = [ lxml ];
    ldf = [ ldfparser ];
    odx = [ lxml ];
    xls = [
      xlrd
      xlwt
    ];
    xlsx = [ openpyxl ];
    yaml = [ pyyaml ];
  };

  nativeCheckInputs = [
    pytest-cov-stub
    pytest-timeout
    pytestCheckHook
  ]
  ++ lib.concatAttrValues optional-dependencies;

  pytestFlags = [
    # long_envvar_name_imports requires stable key value pair ordering
    "-s"
  ];

  enabledTestPaths = [
    "src/canmatrix"
    "tests/"
  ];

  disabledTests = [ "long_envvar_name_imports" ];

  pythonImportsCheck = [ "canmatrix" ];

  meta = {
    description = "Support and convert several CAN (Controller Area Network) database formats";
    homepage = "https://github.com/ebroecker/canmatrix";
    changelog = "https://github.com/ebroecker/canmatrix/releases/tag/${version}";
    license = lib.licenses.bsd2;
    maintainers = with lib.maintainers; [ sorki ];
  };
}