Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / gradient-utils / default.nix
blob3d3cd47cf41eb7949d392a6422bb534bd94bed7f
1 { lib
2 , buildPythonPackage
3 , fetchFromGitHub
4 , hyperopt
5 , mock
6 , numpy
7 , poetry-core
8 , prometheus-client
9 , pytestCheckHook
10 , pythonOlder
11 , requests
14 buildPythonPackage rec {
15   pname = "gradient-utils";
16   version = "0.5.0";
17   format = "pyproject";
19   disabled = pythonOlder "3.6";
21   src = fetchFromGitHub {
22     owner = "Paperspace";
23     repo = pname;
24     rev = "refs/tags/v${version}";
25     hash = "sha256-swnl0phdOsBSP8AX/OySI/aYI9z60Ss3SsJox/mb9KY=";
26   };
28   nativeBuildInputs = [
29     poetry-core
30   ];
32   propagatedBuildInputs = [
33     hyperopt
34     prometheus-client
35     numpy
36   ];
38   nativeCheckInputs = [
39     mock
40     requests
41     pytestCheckHook
42   ];
44   postPatch = ''
45     # https://github.com/Paperspace/gradient-utils/issues/68
46     # https://github.com/Paperspace/gradient-utils/issues/72
47     substituteInPlace pyproject.toml \
48       --replace 'wheel = "^0.35.1"' 'wheel = "*"' \
49       --replace 'prometheus-client = ">=0.8,<0.10"' 'prometheus-client = "*"' \
50       --replace 'pymongo = "^3.11.0"' 'pymongo = ">=3.11.0"'
51   '';
53   preCheck = ''
54     export HOSTNAME=myhost-experimentId
55   '';
57   disabledTestPaths = [
58     # Requires a working Prometheus push gateway
59     "tests/integration/test_metrics.py"
60   ];
62   pythonImportsCheck = [
63     "gradient_utils"
64   ];
66   meta = with lib; {
67     description = "Python utils and helpers library for Gradient";
68     homepage = "https://github.com/Paperspace/gradient-utils";
69     license = licenses.mit;
70     maintainers = with maintainers; [ freezeboy ];
71     platforms = platforms.unix;
72   };