diff --git a/pkgs/development/python-modules/POT/default.nix b/pkgs/development/python-modules/POT/default.nix new file mode 100644 index 000000000000..a72303f6b4cc --- /dev/null +++ b/pkgs/development/python-modules/POT/default.nix @@ -0,0 +1,54 @@ +{ 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 ]; + + 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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 14e2f7759f62..e64ac018cbbd 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5571,6 +5571,8 @@ in { postorius = callPackage ../servers/mail/mailman/postorius.nix { }; + POT = callPackage ../development/python-modules/POT { }; + potr = callPackage ../development/python-modules/potr { }; power = callPackage ../development/python-modules/power { };