1{
2 lib,
3 buildPythonPackage,
4 cmake,
5 cvxopt,
6 fetchPypi,
7 future,
8 numpy,
9 oldest-supported-numpy,
10 pytestCheckHook,
11 pythonOlder,
12 pythonRelaxDepsHook,
13 qdldl,
14 scipy,
15 setuptools-scm,
16}:
17
18buildPythonPackage rec {
19 pname = "osqp";
20 version = "0.6.5";
21 pyproject = true;
22
23 disabled = pythonOlder "3.7";
24
25 src = fetchPypi {
26 inherit pname version;
27 hash = "sha256-soEK7nviNzrdi2wL5a2ZuBAoh3SrykIXUcsDLWpa7e8=";
28 };
29
30 dontUseCmakeConfigure = true;
31
32 nativeBuildInputs = [
33 cmake
34 oldest-supported-numpy
35 setuptools-scm
36 pythonRelaxDepsHook
37 ];
38
39 pythonRelaxDeps = [ "scipy" ];
40
41 propagatedBuildInputs = [
42 future
43 numpy
44 qdldl
45 scipy
46 ];
47
48 nativeCheckInputs = [
49 cvxopt
50 pytestCheckHook
51 ];
52
53 pythonImportsCheck = [ "osqp" ];
54
55 disabledTests =
56 [
57 # Need an unfree license package - mkl
58 "test_issue14"
59 ]
60 # disable tests failing after scipy 1.12 update
61 # https://github.com/osqp/osqp-python/issues/121
62 # re-enable once unit tests fixed
63 ++ [
64 "feasibility_tests"
65 "polish_tests"
66 "update_matrices_tests"
67 ];
68
69 meta = with lib; {
70 description = "The Operator Splitting QP Solver";
71 longDescription = ''
72 Numerical optimization package for solving problems in the form
73 minimize 0.5 x' P x + q' x
74 subject to l <= A x <= u
75
76 where x in R^n is the optimization variable
77 '';
78 homepage = "https://osqp.org/";
79 downloadPage = "https://github.com/oxfordcontrol/osqp-python/releases";
80 license = licenses.asl20;
81 maintainers = with maintainers; [ drewrisinger ];
82 };
83}