python3Packages.gradient-utils: fix build

This commit is contained in:
Fabian Affolter 2021-03-16 09:30:55 +01:00 committed by Tim Steinbach
parent 41f345cbfc
commit 459315303c

View File

@ -1,12 +1,13 @@
{ buildPythonPackage { lib
, buildPythonPackage
, fetchFromGitHub , fetchFromGitHub
, hyperopt , hyperopt
, lib
, mock , mock
, numpy , numpy
, poetry , poetry-core
, prometheus_client , prometheus_client
, pytestCheckHook , pytestCheckHook
, requests
}: }:
buildPythonPackage rec { buildPythonPackage rec {
@ -24,23 +25,39 @@ buildPythonPackage rec {
postPatch = '' postPatch = ''
substituteInPlace pyproject.toml \ substituteInPlace pyproject.toml \
--replace 'numpy = "1.18.5"' 'numpy = "^1.18.5"' \ --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 ]; nativeBuildInputs = [ poetry-core ];
checkInputs = [ mock pytestCheckHook ];
propagatedBuildInputs = [ hyperopt prometheus_client numpy ]; propagatedBuildInputs = [
hyperopt
prometheus_client
numpy
];
checkInputs = [
mock
requests
pytestCheckHook
];
preCheck = ''
export HOSTNAME=myhost-experimentId
'';
preCheck = "export HOSTNAME=myhost-experimentId";
disabledTests = [ disabledTests = [
"test_add_metrics_pushes_metrics" # requires a working prometheus push gateway "test_add_metrics_pushes_metrics" # requires a working prometheus push gateway
]; ];
pythonImportsCheck = [ "gradient_utils" ];
meta = with lib; { meta = with lib; {
description = "Gradient ML SDK"; description = "Python utils and helpers library for Gradient";
homepage = "https://github.com/Paperspace/gradient-utils"; homepage = "https://github.com/Paperspace/gradient-utils";
license = licenses.mit; license = licenses.mit;
platforms = platforms.unix; platforms = platforms.unix;
maintainers = with maintainers; [ freezeboy ]; maintainers = with maintainers; [ freezeboy ];
}; };
} }