mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-08-25 17:55:21 +00:00
python3Packages.pot: minor fixes from PR review
This commit is contained in:
55
pkgs/development/python-modules/pot/default.nix
Normal file
55
pkgs/development/python-modules/pot/default.nix
Normal file
@@ -0,0 +1,55 @@
|
||||
{ lib
|
||||
, fetchPypi
|
||||
, buildPythonPackage
|
||||
, numpy
|
||||
, scipy
|
||||
, cython
|
||||
, matplotlib
|
||||
, scikit-learn
|
||||
, cupy
|
||||
, pymanopt
|
||||
, autograd
|
||||
, pytestCheckHook
|
||||
, enableDimensionalityReduction ? false
|
||||
, enableGPU ? false
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "pot";
|
||||
version = "0.7.0";
|
||||
|
||||
src = fetchPypi {
|
||||
pname = "POT";
|
||||
inherit version;
|
||||
sha256 = "01mdsiv8rlgqzvm3bds9aj49khnn33i523c2cqqrl10zg742pb6l";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace setup.cfg \
|
||||
--replace "--cov-report= --cov=ot" ""
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ numpy cython ];
|
||||
propagatedBuildInputs = [ numpy scipy ]
|
||||
++ lib.optionals enableGPU [ cupy ]
|
||||
++ lib.optionals enableDimensionalityReduction [ pymanopt autograd ];
|
||||
checkInputs = [ matplotlib scikit-learn pytestCheckHook ];
|
||||
|
||||
# To prevent importing of an incomplete package from the build directory
|
||||
# instead of nix store (`ot` is the top-level package name).
|
||||
preCheck = ''
|
||||
rm -r ot
|
||||
'';
|
||||
|
||||
# GPU tests are always skipped because of sandboxing
|
||||
disabledTests = [ "warnings" ];
|
||||
|
||||
pythonImportsCheck = [ "ot" "ot.lp" ];
|
||||
|
||||
meta = {
|
||||
description = "Python Optimal Transport Library";
|
||||
homepage = "https://pythonot.github.io/";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ yl3dy ];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user