2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
2021-04-13 19:44:15 +00:00
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, cvxopt
|
|
|
|
, ecos
|
2023-05-24 13:37:59 +00:00
|
|
|
, fetchPypi
|
2020-04-24 23:36:52 +00:00
|
|
|
, numpy
|
|
|
|
, osqp
|
2023-05-24 13:37:59 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
2020-04-24 23:36:52 +00:00
|
|
|
, scipy
|
|
|
|
, scs
|
2022-11-02 22:02:43 +00:00
|
|
|
, setuptools
|
2021-05-20 23:08:51 +00:00
|
|
|
, useOpenmp ? (!stdenv.isDarwin)
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "cvxpy";
|
2023-08-10 07:59:29 +00:00
|
|
|
version = "1.3.2";
|
2021-04-13 19:44:15 +00:00
|
|
|
format = "pyproject";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-08-10 07:59:29 +00:00
|
|
|
hash = "sha256-C2heUEDxmfPXA/MPXSLR+GVZdiNFUVPR3ddwJFrvCXU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
cvxopt
|
|
|
|
ecos
|
|
|
|
numpy
|
|
|
|
osqp
|
|
|
|
scipy
|
|
|
|
scs
|
2022-11-02 22:02:43 +00:00
|
|
|
setuptools
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
# Required flags from https://github.com/cvxpy/cvxpy/releases/tag/v1.1.11
|
2021-08-22 07:53:02 +00:00
|
|
|
preBuild = lib.optionalString useOpenmp ''
|
2021-04-13 19:44:15 +00:00
|
|
|
export CFLAGS="-fopenmp"
|
|
|
|
export LDFLAGS="-lgomp"
|
|
|
|
'';
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
"cvxpy"
|
|
|
|
];
|
2021-07-04 02:40:35 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
disabledTests = [
|
2023-05-24 13:37:59 +00:00
|
|
|
# Disable the slowest benchmarking tests, cuts test time in half
|
2020-09-25 04:45:31 +00:00
|
|
|
"test_tv_inpainting"
|
|
|
|
"test_diffcp_sdp_example"
|
2022-11-02 22:02:43 +00:00
|
|
|
"test_huber"
|
|
|
|
"test_partial_problem"
|
2021-04-13 19:44:15 +00:00
|
|
|
] ++ lib.optionals stdenv.isAarch64 [
|
2023-05-24 13:37:59 +00:00
|
|
|
"test_ecos_bb_mi_lp_2" # https://github.com/cvxpy/cvxpy/issues/1241#issuecomment-780912155
|
2020-09-25 04:45:31 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"cvxpy"
|
|
|
|
];
|
2021-07-04 02:40:35 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
2021-02-19 19:06:45 +00:00
|
|
|
description = "A domain-specific language for modeling convex optimization problems in Python";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://www.cvxpy.org/";
|
2023-05-24 13:37:59 +00:00
|
|
|
downloadPage = "https://github.com/cvxpy/cvxpy//releases";
|
|
|
|
changelog = "https://github.com/cvxpy/cvxpy/releases/tag/v${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ drewrisinger ];
|
|
|
|
};
|
|
|
|
}
|