From fc78ec96796fc371f5851d792e9f8ca1fc5a232c Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 3 Jun 2022 14:06:53 +0200 Subject: [PATCH] python310Packages.dask-glm: handle optional dependencies --- .../python-modules/dask-glm/default.nix | 54 ++++++++++++++----- 1 file changed, 42 insertions(+), 12 deletions(-) diff --git a/pkgs/development/python-modules/dask-glm/default.nix b/pkgs/development/python-modules/dask-glm/default.nix index 9072a691c20a..bd9b468064dd 100644 --- a/pkgs/development/python-modules/dask-glm/default.nix +++ b/pkgs/development/python-modules/dask-glm/default.nix @@ -1,33 +1,63 @@ { lib , buildPythonPackage -, fetchPypi , cloudpickle , dask -, numpy, toolz # dask[array] +, distributed +, fetchPypi , multipledispatch -, setuptools-scm -, scipy -, scikit-learn , pytestCheckHook +, pythonOlder +, scikit-learn +, scipy +, setuptools-scm +, sparse }: buildPythonPackage rec { - version = "0.2.0"; pname = "dask-glm"; + version = "0.2.0"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - sha256 = "58b86cebf04fe5b9e58092e1c467e32e60d01e11b71fdc628baaa9fc6d1adee5"; + hash = "sha256-WLhs6/BP5bnlgJLhxGfjLmDQHhG3H9xii6qp/G0a3uU="; }; - nativeBuildInputs = [ setuptools-scm ]; - checkInputs = [ pytestCheckHook ]; - propagatedBuildInputs = [ cloudpickle dask numpy toolz multipledispatch scipy scikit-learn ]; + nativeBuildInputs = [ + setuptools-scm + ]; + + propagatedBuildInputs = [ + cloudpickle + distributed + multipledispatch + scikit-learn + scipy + sparse + ] ++ dask.optional-dependencies.array; + + checkInputs = [ + sparse + pytestCheckHook + ]; + + pythonImportsCheck = [ + "dask_glm" + ]; + + disabledTestPaths = [ + # Circular dependency with dask-ml + "dask_glm/tests/test_estimators.py" + # Test tries to imort an obsolete method + "dask_glm/tests/test_utils.py" + ]; meta = with lib; { - homepage = "https://github.com/dask/dask-glm/"; description = "Generalized Linear Models with Dask"; + homepage = "https://github.com/dask/dask-glm/"; license = licenses.bsd3; - maintainers = [ maintainers.costrouc ]; + maintainers = with maintainers; [ costrouc ]; }; }