snac2: 2.68 -> 2.70 (#379043)
[NixPkgs.git] / pkgs / development / python-modules / osqp / default.nix
blob83fd6645cde73a5ab2f994d13675ba1fa1f33d07
2   lib,
3   buildPythonPackage,
4   cmake,
5   cvxopt,
6   fetchPypi,
7   future,
8   numpy,
9   oldest-supported-numpy,
10   pytestCheckHook,
11   pythonOlder,
12   qdldl,
13   scipy,
14   setuptools-scm,
17 buildPythonPackage rec {
18   pname = "osqp";
19   version = "0.6.7.post3";
20   pyproject = true;
22   disabled = pythonOlder "3.7";
24   src = fetchPypi {
25     inherit pname version;
26     hash = "sha256-sMXgpyHyHJckCXpP1QEIME0pZGjRJOFvNKxnBG9wIOE=";
27   };
29   postPatch = ''
30     substituteInPlace pyproject.toml \
31       --replace-fail "numpy >= 2.0.0" numpy
32   '';
34   dontUseCmakeConfigure = true;
36   nativeBuildInputs = [
37     cmake
38     numpy
39     oldest-supported-numpy
40     setuptools-scm
41   ];
43   pythonRelaxDeps = [
44     "scipy"
45   ];
47   propagatedBuildInputs = [
48     numpy
49     qdldl
50     scipy
51   ];
53   nativeCheckInputs = [
54     cvxopt
55     pytestCheckHook
56   ];
58   pythonImportsCheck = [ "osqp" ];
60   disabledTests =
61     [
62       # Need an unfree license package - mkl
63       "test_issue14"
64     ]
65     # disable tests failing after scipy 1.12 update
66     # https://github.com/osqp/osqp-python/issues/121
67     # re-enable once unit tests fixed
68     ++ [
69       "feasibility_tests"
70       "polish_tests"
71       "update_matrices_tests"
72     ];
74   meta = with lib; {
75     description = "Operator Splitting QP Solver";
76     longDescription = ''
77       Numerical optimization package for solving problems in the form
78         minimize        0.5 x' P x + q' x
79         subject to      l <= A x <= u
81       where x in R^n is the optimization variable
82     '';
83     homepage = "https://osqp.org/";
84     downloadPage = "https://github.com/oxfordcontrol/osqp-python/releases";
85     license = licenses.asl20;
86     maintainers = with maintainers; [ drewrisinger ];
87   };