about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/daqp/default.nix
blob: 9ef1d3eee877751bd360b222af868aab0bc1c78a (plain) (blame)
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
{ lib
, stdenv
, fetchFromGitHub
, buildPythonPackage
, unittestCheckHook
, cython
, setuptools
, wheel
, numpy
}:
buildPythonPackage {
  pname = "daqp";
  version = "0.5.1";
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "darnstrom";
    repo = "daqp";
    rev = "5a15a3d16731d3d50f867218c1b281567db556fd";
    hash = "sha256-in7Ci/wM7i0csJ4XVfo1lboWOyfuuU+8E+TzGmMV3x0=";
  };

  sourceRoot = "source/interfaces/daqp-python";

  postPatch = ''
    sed -i 's|../../../daqp|../..|' setup.py
    sed -i 's|if src_path and os.path.exists(src_path):|if False:|' setup.py
  '';

  nativeCheckInputs = [ unittestCheckHook ];

  unittestFlagsArray = [ "-s" "test" "-p" "'*.py'" "-v" ];

  nativeBuildInputs = [
    cython
    setuptools
    wheel
  ];

  propagatedBuildInputs = [
    numpy
  ];

  pythonImportsCheck = [ "daqp" ];

  meta = with lib; {
    description = "A dual active-set algorithm for convex quadratic programming";
    homepage = "https://github.com/darnstrom/daqp";
    license = licenses.mit;
    maintainers = with maintainers; [ renesat ];
  };
}