1{
2 lib,
3 fetchFromGitHub,
4 buildPythonPackage,
5 unittestCheckHook,
6 cython,
7 setuptools,
8 wheel,
9 numpy,
10}:
11buildPythonPackage rec {
12 pname = "daqp";
13 version = "0.7.2";
14 format = "pyproject";
15
16 src = fetchFromGitHub {
17 owner = "darnstrom";
18 repo = "daqp";
19 tag = "v${version}";
20 hash = "sha256-I+ObnFAAhRoYtPEDXGP6BI+Zk9CH5yU27JJ+tWbcACQ=";
21 };
22
23 sourceRoot = "${src.name}/interfaces/daqp-python";
24
25 postPatch = ''
26 sed -i 's|../../../daqp|../..|' setup.py
27 sed -i 's|if src_path and os.path.exists(src_path):|if False:|' setup.py
28 '';
29
30 nativeCheckInputs = [ unittestCheckHook ];
31
32 unittestFlagsArray = [
33 "-s"
34 "test"
35 "-p"
36 "'*.py'"
37 "-v"
38 ];
39
40 nativeBuildInputs = [
41 cython
42 setuptools
43 wheel
44 ];
45
46 propagatedBuildInputs = [ numpy ];
47
48 pythonImportsCheck = [ "daqp" ];
49
50 meta = with lib; {
51 description = "Dual active-set algorithm for convex quadratic programming";
52 homepage = "https://github.com/darnstrom/daqp";
53 license = licenses.mit;
54 maintainers = with maintainers; [ renesat ];
55 };
56}