-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4b4a85c
commit 1186e7e
Showing
1 changed file
with
27 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,57 @@ | ||
{ | ||
lib, | ||
buildPythonPackage, | ||
fetchFromGitLab, | ||
fetchPypi, | ||
numpy, | ||
cvxopt, | ||
python, | ||
networkx, | ||
scipy, | ||
pythonOlder, | ||
stdenv, | ||
}: | ||
|
||
buildPythonPackage rec { | ||
pname = "picos"; | ||
version = "2.0"; | ||
version = "2.5.1"; | ||
format = "setuptools"; | ||
|
||
src = fetchFromGitLab { | ||
owner = "picos-api"; | ||
repo = "picos"; | ||
rev = "v${version}"; | ||
sha256 = "1k65iq791k5r08gh2kc6iz0xw1wyzqik19j6iam8ip732r7jm607"; | ||
src = fetchPypi { | ||
inherit pname version; | ||
hash = "sha256-Zmtzhfeu0FURK7pCDJ7AsZc6ElZfrt73rVH3g8OkkCs="; | ||
}; | ||
|
||
# Needed only for the tests | ||
nativeCheckInputs = [ networkx ]; | ||
|
||
propagatedBuildInputs = [ | ||
dependencies = [ | ||
numpy | ||
cvxopt | ||
scipy | ||
]; | ||
|
||
postPatch = | ||
lib.optionalString (pythonOlder "3.12") '' | ||
substituteInPlace picos/modeling/problem.py \ | ||
--replace-fail "mappingproxy(OrderedDict({'x': <3×1 Real Variable: x>}))" "mappingproxy(OrderedDict([('x', <3×1 Real Variable: x>)]))" | ||
'' | ||
# TypeError: '<=' not supported between instances of 'ComplexAffineExpression' and 'float' | ||
+ lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) '' | ||
rm tests/ptest_quantentr.py | ||
''; | ||
|
||
checkPhase = '' | ||
runHook preCheck | ||
${python.interpreter} test.py | ||
runHook postCheck | ||
''; | ||
|
||
meta = with lib; { | ||
meta = { | ||
description = "Python interface to conic optimization solvers"; | ||
homepage = "https://gitlab.com/picos-api/picos"; | ||
license = licenses.gpl3; | ||
maintainers = with maintainers; [ tobiasBora ]; | ||
license = lib.licenses.gpl3; | ||
maintainers = with lib.maintainers; [ tobiasBora ]; | ||
}; | ||
} |