From e38b7b1cef7d9b6b7d25694a72bd80cf46ec969b Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 7 Jan 2022 12:22:17 +0100 Subject: [PATCH 1/3] python3Packages.gradient-utils: disable metrics tests --- .../python-modules/gradient-utils/default.nix | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/pkgs/development/python-modules/gradient-utils/default.nix b/pkgs/development/python-modules/gradient-utils/default.nix index b7424c44f6de..e81d815e8c20 100644 --- a/pkgs/development/python-modules/gradient-utils/default.nix +++ b/pkgs/development/python-modules/gradient-utils/default.nix @@ -7,6 +7,7 @@ , poetry-core , prometheus-client , pytestCheckHook +, pythonOlder , requests }: @@ -15,6 +16,8 @@ buildPythonPackage rec { version = "0.5.0"; format = "pyproject"; + disabled = pythonOlder "3.6"; + src = fetchFromGitHub { owner = "Paperspace"; repo = pname; @@ -22,15 +25,9 @@ buildPythonPackage rec { sha256 = "19plkgwwfs6298vjplgsvhirixi3jbngq5y07x9c0fjxk39fa2dk"; }; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace 'numpy = "1.18.5"' 'numpy = "^1.18.5"' \ - --replace 'hyperopt = "0.1.2"' 'hyperopt = ">=0.1.2"' \ - --replace 'wheel = "^0.35.1"' 'wheel = "*"' \ - --replace 'prometheus-client = ">=0.8,<0.10"' 'prometheus-client = "*"' - ''; - - nativeBuildInputs = [ poetry-core ]; + nativeBuildInputs = [ + poetry-core + ]; propagatedBuildInputs = [ hyperopt @@ -44,15 +41,24 @@ buildPythonPackage rec { pytestCheckHook ]; + postPatch = '' + substituteInPlace pyproject.toml \ + --replace 'wheel = "^0.35.1"' 'wheel = "*"' \ + --replace 'prometheus-client = ">=0.8,<0.10"' 'prometheus-client = "*"' + ''; + preCheck = '' export HOSTNAME=myhost-experimentId ''; - disabledTests = [ - "test_add_metrics_pushes_metrics" # requires a working prometheus push gateway + disabledTestPaths = [ + # Requires a working Prometheus push gateway + "tests/integration/test_metrics.py" ]; - pythonImportsCheck = [ "gradient_utils" ]; + pythonImportsCheck = [ + "gradient_utils" + ]; meta = with lib; { description = "Python utils and helpers library for Gradient"; From 947a771b0407703ad57d97fb6e576047d2886de8 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 7 Jan 2022 14:05:30 +0100 Subject: [PATCH 2/3] python3Packages.gql: init at 3.0.0rc0 --- .../python-modules/gql/default.nix | 77 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 79 insertions(+) create mode 100644 pkgs/development/python-modules/gql/default.nix diff --git a/pkgs/development/python-modules/gql/default.nix b/pkgs/development/python-modules/gql/default.nix new file mode 100644 index 000000000000..65e4bbde319b --- /dev/null +++ b/pkgs/development/python-modules/gql/default.nix @@ -0,0 +1,77 @@ +{ lib +, aiofiles +, aiohttp +, botocore +, buildPythonPackage +, fetchFromGitHub +, graphql-core +, mock +, parse +, pytest-asyncio +, pytestCheckHook +, pythonOlder +, requests +, requests-toolbelt +, urllib3 +, vcrpy +, websockets +, yarl +}: + +buildPythonPackage rec { + pname = "gql"; + version = "3.0.0rc0"; + format = "setuptools"; + + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "graphql-python"; + repo = pname; + rev = "v${version}"; + hash = "sha256-yr1DyMj/0C9XPTyGdbQbn7nMRKr4JwItFDsqvl/goqU="; + }; + + propagatedBuildInputs = [ + aiohttp + botocore + graphql-core + requests + requests-toolbelt + urllib3 + websockets + yarl + ]; + + checkInputs = [ + aiofiles + mock + parse + pytest-asyncio + pytestCheckHook + vcrpy + ]; + + disabledTests = [ + # Tests requires network access + "test_execute_result_error" + "test_http_transport" + ]; + + disabledTestPaths = [ + # Exclude linter tests + "gql-checker/tests/test_flake8_linter.py" + "gql-checker/tests/test_pylama_linter.py" + ]; + + pythonImportsCheck = [ + "gql" + ]; + + meta = with lib; { + description = "GraphQL client in Python"; + homepage = "https://github.com/graphql-python/gql"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index cb114c656ae9..d3daf8e048c7 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3419,6 +3419,8 @@ in { gpyopt = callPackage ../development/python-modules/gpyopt { }; + gql = callPackage ../development/python-modules/gql { }; + gradient = callPackage ../development/python-modules/gradient { }; gradient-utils = callPackage ../development/python-modules/gradient-utils { }; From 03ca8743152359935c11737e690cb659724f72a2 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 7 Jan 2022 14:12:15 +0100 Subject: [PATCH 3/3] python3Packages.gradient: 1.8.13 -> 1.9.1 --- .../python-modules/gradient/default.nix | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/gradient/default.nix b/pkgs/development/python-modules/gradient/default.nix index 735dc03b6df7..026c61fc6157 100644 --- a/pkgs/development/python-modules/gradient/default.nix +++ b/pkgs/development/python-modules/gradient/default.nix @@ -9,6 +9,7 @@ , fetchPypi , gradient_statsd , gradient-utils +, gql , halo , marshmallow , progressbar2 @@ -22,17 +23,19 @@ buildPythonPackage rec { pname = "gradient"; - version = "1.8.13"; + version = "1.9.1"; + format = "setuptools"; src = fetchPypi { inherit pname version; - sha256 = "0fa4a0553c28839e364d3aac27ec7292d26c1df27b8c54701d57eb7eda0b14f2"; + hash = "sha256-zimOh4bc9EQGpqMky/etwnAF04onJ2m/KAl29IaAeAY="; }; postPatch = '' substituteInPlace setup.py \ --replace 'attrs<=' 'attrs>=' \ --replace 'colorama==' 'colorama>=' \ + --replace 'gql[requests]==3.0.0a6' 'gql' \ --replace 'PyYAML==' 'PyYAML>=' \ --replace 'marshmallow<' 'marshmallow>=' \ --replace 'websocket-client==' 'websocket-client>=' @@ -45,6 +48,7 @@ buildPythonPackage rec { click-didyoumean click-help-colors colorama + gql gradient_statsd gradient-utils halo @@ -58,17 +62,20 @@ buildPythonPackage rec { websocket-client ]; - # tries to use /homeless-shelter to mimic container usage, etc + # Tries to use /homeless-shelter to mimic container usage, etc doCheck = false; + # marshmallow.exceptions.StringNotCollectionError: "only" should be a collection of strings. + # Support for marshmallow > 3 + # pythonImportsCheck = [ + # "gradient" + # ]; + meta = with lib; { description = "The command line interface for Gradient"; homepage = "https://github.com/Paperspace/gradient-cli"; license = licenses.isc; platforms = platforms.unix; maintainers = with maintainers; [ thoughtpolice ]; - # There is no support for click > 8 - # https://github.com/Paperspace/gradient-cli/issues/368 - broken = true; }; }