From 459315303cb87e4e1bd9be90fda59687a31e430a Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 16 Mar 2021 09:30:55 +0100 Subject: [PATCH] python3Packages.gradient-utils: fix build --- .../python-modules/gradient-utils/default.nix | 41 +++++++++++++------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/pkgs/development/python-modules/gradient-utils/default.nix b/pkgs/development/python-modules/gradient-utils/default.nix index cf0ffb6bb41..49fff6f6cee 100644 --- a/pkgs/development/python-modules/gradient-utils/default.nix +++ b/pkgs/development/python-modules/gradient-utils/default.nix @@ -1,12 +1,13 @@ -{ buildPythonPackage +{ lib +, buildPythonPackage , fetchFromGitHub , hyperopt -, lib , mock , numpy -, poetry +, poetry-core , prometheus_client , pytestCheckHook +, requests }: buildPythonPackage rec { @@ -24,23 +25,39 @@ buildPythonPackage rec { postPatch = '' substituteInPlace pyproject.toml \ --replace 'numpy = "1.18.5"' 'numpy = "^1.18.5"' \ - --replace 'hyperopt = "0.1.2"' 'hyperopt = ">=0.1.2"' + --replace 'hyperopt = "0.1.2"' 'hyperopt = ">=0.1.2"' \ + --replace 'wheel = "^0.35.1"' 'wheel = "^0.36"' ''; - nativeBuildInputs = [ poetry ]; - checkInputs = [ mock pytestCheckHook ]; - propagatedBuildInputs = [ hyperopt prometheus_client numpy ]; + nativeBuildInputs = [ poetry-core ]; + + propagatedBuildInputs = [ + hyperopt + prometheus_client + numpy + ]; + + checkInputs = [ + mock + requests + pytestCheckHook + ]; + + preCheck = '' + export HOSTNAME=myhost-experimentId + ''; - preCheck = "export HOSTNAME=myhost-experimentId"; disabledTests = [ "test_add_metrics_pushes_metrics" # requires a working prometheus push gateway ]; + pythonImportsCheck = [ "gradient_utils" ]; + meta = with lib; { - description = "Gradient ML SDK"; - homepage = "https://github.com/Paperspace/gradient-utils"; - license = licenses.mit; - platforms = platforms.unix; + description = "Python utils and helpers library for Gradient"; + homepage = "https://github.com/Paperspace/gradient-utils"; + license = licenses.mit; + platforms = platforms.unix; maintainers = with maintainers; [ freezeboy ]; }; }