1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6 flit-core,
7 z3-solver,
8 astroid,
9 pytestCheckHook,
10 hypothesis,
11 pythonRelaxDepsHook,
12}:
13
14buildPythonPackage rec {
15 pname = "deal-solver";
16 version = "0.1.2";
17 format = "pyproject";
18
19 disabled = pythonOlder "3.7";
20
21 src = fetchFromGitHub {
22 owner = "life4";
23 repo = pname;
24 rev = "refs/tags/${version}";
25 hash = "sha256-DAOeQLFR/JED32uJSW7W9+Xx5f1Et05W8Fp+Vm7sfZo=";
26 };
27
28 nativeBuildInputs = [
29 flit-core
30 pythonRelaxDepsHook
31 ];
32
33 # z3 does not provide a dist-info, so python-runtime-deps-check will fail
34 pythonRemoveDeps = [ "z3-solver" ];
35
36 postPatch = ''
37 substituteInPlace pyproject.toml \
38 --replace "\"--cov=deal_solver\"," "" \
39 --replace "\"--cov-report=html\"," "" \
40 --replace "\"--cov-report=xml\"," "" \
41 --replace "\"--cov-report=term-missing:skip-covered\"," "" \
42 --replace "\"--cov-fail-under=100\"," ""
43 '';
44
45 propagatedBuildInputs = [
46 z3-solver
47 astroid
48 ] ++ z3-solver.requiredPythonModules;
49
50 nativeCheckInputs = [
51 pytestCheckHook
52 hypothesis
53 ];
54
55 pythonImportsCheck = [ "deal_solver" ];
56
57 meta = with lib; {
58 description = "Z3-powered solver (theorem prover) for deal";
59 homepage = "https://github.com/life4/deal-solver";
60 changelog = "https://github.com/life4/deal-solver/releases/tag/${version}";
61 license = licenses.mit;
62 maintainers = with maintainers; [ gador ];
63 };
64}