python3Packages.gradient-utils: added tests
This commit is contained in:
parent
dc00214974
commit
07c21216df
@ -1,28 +1,40 @@
|
|||||||
{ buildPythonPackage
|
{ buildPythonPackage
|
||||||
, fetchPypi
|
, fetchFromGitHub
|
||||||
, hyperopt
|
, hyperopt
|
||||||
, lib
|
, lib
|
||||||
|
, mock
|
||||||
, numpy
|
, numpy
|
||||||
|
, poetry
|
||||||
, prometheus_client
|
, prometheus_client
|
||||||
|
, pytestCheckHook
|
||||||
}:
|
}:
|
||||||
|
|
||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
pname = "gradient-utils";
|
pname = "gradient-utils";
|
||||||
version = "0.3.2";
|
version = "0.3.2";
|
||||||
|
format = "pyproject";
|
||||||
|
|
||||||
src = fetchPypi {
|
src = fetchFromGitHub {
|
||||||
inherit pname version;
|
owner = "Paperspace";
|
||||||
sha256 = "0a99yygv30vibfawk6zd1jd6lva8fjnr99l1ahaf0nqjyw6jl4nw";
|
repo = pname;
|
||||||
|
rev = "v${version}";
|
||||||
|
sha256 = "083hnkv19mhvdc8nx28f1nph50c903gxh9g9q8531abv0w8m0744";
|
||||||
};
|
};
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
sed -i 's/hyperopt==0.1.2/hyperopt>=0.1.2/' setup.py
|
substituteInPlace pyproject.toml \
|
||||||
sed -i 's/numpy==1.18.5/numpy>=1.18.5/' setup.py
|
--replace 'numpy = "1.18.5"' 'numpy = "^1.18.5"' \
|
||||||
|
--replace 'hyperopt = "0.1.2"' 'hyperopt = ">=0.1.2"'
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
nativeBuildInputs = [ poetry ];
|
||||||
|
checkInputs = [ mock pytestCheckHook ];
|
||||||
propagatedBuildInputs = [ hyperopt prometheus_client numpy ];
|
propagatedBuildInputs = [ hyperopt prometheus_client numpy ];
|
||||||
|
|
||||||
pythonImportsCheck = [ "gradient_utils" ];
|
preCheck = "export HOSTNAME=myhost-experimentId";
|
||||||
|
disabledTests = [
|
||||||
|
"test_add_metrics_pushes_metrics" # requires a working prometheus push gateway
|
||||||
|
];
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Gradient ML SDK";
|
description = "Gradient ML SDK";
|
||||||
|
Loading…
Reference in New Issue
Block a user