summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/deal-solver/default.nix
blob: 1b6a753228711eb5b8137c844237cd04f8aec9e0 (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
{
  lib,
  astroid,
  buildPythonPackage,
  fetchFromGitHub,
  flit-core,
  hypothesis,
  pytest-cov-stub,
  pytest-xdist,
  pytestCheckHook,
  z3-solver,
}:

buildPythonPackage rec {
  pname = "deal-solver";
  version = "0.1.2";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "life4";
    repo = "deal-solver";
    tag = version;
    hash = "sha256-DAOeQLFR/JED32uJSW7W9+Xx5f1Et05W8Fp+Vm7sfZo=";
  };

  build-system = [ flit-core ];

  # z3 does not provide a dist-info, so python-runtime-deps-check will fail
  pythonRemoveDeps = [ "z3-solver" ];

  dependencies = [
    z3-solver
    astroid
  ]
  ++ z3-solver.requiredPythonModules;

  nativeCheckInputs = [
    hypothesis
    pytest-cov-stub
    pytest-xdist
    pytestCheckHook
  ];

  pythonImportsCheck = [ "deal_solver" ];

  disabledTests = [
    # Flaky tests, sometimes it works sometimes it doesn't
    "test_expr_asserts_ok"
    "test_fuzz_math_floats"
  ];

  meta = {
    description = "Z3-powered solver (theorem prover) for deal";
    homepage = "https://github.com/life4/deal-solver";
    changelog = "https://github.com/life4/deal-solver/releases/tag/${version}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ gador ];
  };
}