2021-01-23 03:43:02 +00:00
|
|
|
{ buildPythonPackage
|
2021-01-31 17:38:10 +00:00
|
|
|
, fetchFromGitHub
|
2021-01-23 03:43:02 +00:00
|
|
|
, hyperopt
|
|
|
|
, lib
|
2021-01-31 17:38:10 +00:00
|
|
|
, mock
|
2021-01-23 03:43:02 +00:00
|
|
|
, numpy
|
2021-01-31 17:38:10 +00:00
|
|
|
, poetry
|
2021-01-23 03:43:02 +00:00
|
|
|
, prometheus_client
|
2021-01-31 17:38:10 +00:00
|
|
|
, pytestCheckHook
|
2021-01-23 03:43:02 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "gradient-utils";
|
|
|
|
version = "0.3.2";
|
2021-01-31 17:38:10 +00:00
|
|
|
format = "pyproject";
|
2021-01-23 03:43:02 +00:00
|
|
|
|
2021-01-31 17:38:10 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Paperspace";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "083hnkv19mhvdc8nx28f1nph50c903gxh9g9q8531abv0w8m0744";
|
2021-01-23 03:43:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
2021-01-31 17:38:10 +00:00
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace 'numpy = "1.18.5"' 'numpy = "^1.18.5"' \
|
|
|
|
--replace 'hyperopt = "0.1.2"' 'hyperopt = ">=0.1.2"'
|
2021-01-23 03:43:02 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-31 17:38:10 +00:00
|
|
|
nativeBuildInputs = [ poetry ];
|
|
|
|
checkInputs = [ mock pytestCheckHook ];
|
2021-01-23 03:43:02 +00:00
|
|
|
propagatedBuildInputs = [ hyperopt prometheus_client numpy ];
|
|
|
|
|
2021-01-31 17:38:10 +00:00
|
|
|
preCheck = "export HOSTNAME=myhost-experimentId";
|
|
|
|
disabledTests = [
|
|
|
|
"test_add_metrics_pushes_metrics" # requires a working prometheus push gateway
|
|
|
|
];
|
2021-01-23 03:43:02 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Gradient ML SDK";
|
|
|
|
homepage = "https://github.com/Paperspace/gradient-utils";
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ freezeboy ];
|
|
|
|
};
|
|
|
|
}
|