summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/liberty-parser/default.nix
blob: 84e60242771f10790e2c8eff385e67747ec0b613 (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
{
  lib,
  buildPythonPackage,
  fetchFromGitea,
  setuptools,
  lark,
  numpy,
  sympy,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "liberty-parser";
  version = "0.0.29";
  pyproject = true;

  src = fetchFromGitea {
    domain = "codeberg.org";
    owner = "tok";
    repo = "liberty-parser";
    tag = version;
    hash = "sha256-rPEZIRxvmNrDTVD4NG7v2BT3jJXtTisfs4txCG4OfnQ=";
  };

  # Tests try to write to /tmp directly. use $TMPDIR instead.
  postPatch = ''
    substituteInPlace src/liberty/parser.py \
      --replace-fail "/tmp" "$TMPDIR"
  '';

  build-system = [
    setuptools
  ];

  dependencies = [
    lark
    numpy
    sympy
  ];

  nativeCheckInputs = [
    pytestCheckHook
  ];

  enabledTestPaths = [
    "src/liberty/*.py"
  ];

  pythonImportsCheck = [
    "liberty.parser"
  ];

  meta = {
    description = "Liberty parser for Python";
    homepage = "https://codeberg.org/tok/liberty-parser";
    license = with lib.licenses; [
      asl20
      cc-by-sa-40
      cc0
      gpl3Plus
    ];
    maintainers = with lib.maintainers; [ eljamm ];
    teams = with lib.teams; [ ngi ];
  };
}