2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
buildPythonPackage,
|
|
|
|
unittestCheckHook,
|
|
|
|
flit-core,
|
|
|
|
numpy,
|
|
|
|
scipy,
|
2024-02-29 20:09:43 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# optional dependencies
|
|
|
|
clarabel,
|
|
|
|
cvxopt,
|
|
|
|
daqp,
|
|
|
|
ecos,
|
|
|
|
gurobipy,
|
|
|
|
osqp,
|
|
|
|
quadprog,
|
|
|
|
scs,
|
2023-10-09 19:29:22 +00:00
|
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "qpsolvers";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "4.3.2";
|
2024-02-07 01:22:34 +00:00
|
|
|
pyproject = true;
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "qpsolvers";
|
|
|
|
repo = "qpsolvers";
|
2023-11-16 04:20:00 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-EU7/OGLeOIHw7wyNTibMmHZLAiRTCUFwjEaVNsHg1vw=";
|
2023-10-09 19:29:22 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ flit-core ];
|
2024-02-29 20:09:43 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
pythonImportsCheck = [ "qpsolvers" ];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
numpy
|
|
|
|
scipy
|
|
|
|
];
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
passthru.optional-dependencies = {
|
|
|
|
# FIXME commented out solvers have not been packaged yet
|
|
|
|
clarabel = [ clarabel ];
|
|
|
|
cvxopt = [ cvxopt ];
|
|
|
|
daqp = [ daqp ];
|
|
|
|
ecos = [ ecos ];
|
|
|
|
gurobi = [ gurobipy ];
|
|
|
|
# highs = [ highspy ];
|
|
|
|
# mosek = [ cvxopt mosek ];
|
|
|
|
osqp = [ osqp ];
|
|
|
|
# piqp = [ piqp ];
|
|
|
|
# proxqp = [ proxsuite ];
|
|
|
|
# qpalm = [ qpalm ];
|
|
|
|
quadprog = [ quadprog ];
|
|
|
|
scs = [ scs ];
|
2024-06-05 15:53:02 +00:00
|
|
|
open_source_solvers =
|
|
|
|
with passthru.optional-dependencies;
|
|
|
|
lib.flatten [
|
|
|
|
clarabel
|
|
|
|
cvxopt
|
|
|
|
daqp
|
|
|
|
ecos # highs
|
|
|
|
osqp # piqp proxqp qpalm
|
|
|
|
quadprog
|
|
|
|
scs
|
|
|
|
];
|
2024-02-29 20:09:43 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ unittestCheckHook ] ++ passthru.optional-dependencies.open_source_solvers;
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2024-02-07 01:22:34 +00:00
|
|
|
changelog = "https://github.com/qpsolvers/qpsolvers/blob/${src.rev}/CHANGELOG.md";
|
2023-10-09 19:29:22 +00:00
|
|
|
description = "Quadratic programming solvers in Python with a unified API";
|
|
|
|
homepage = "https://github.com/qpsolvers/qpsolvers";
|
|
|
|
license = licenses.lgpl3Plus;
|
|
|
|
maintainers = with maintainers; [ renesat ];
|
|
|
|
};
|
|
|
|
}
|