From 557dbd85e8abd97eab6b4bed7490c4739697bbd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Tue, 5 Jan 2021 16:43:21 +0100 Subject: [PATCH] pythonPackages.google_cloud_automl: CLeanups --- .../google_cloud_automl/default.nix | 36 ++++++++++++++----- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/google_cloud_automl/default.nix b/pkgs/development/python-modules/google_cloud_automl/default.nix index 3ad8dcb12fb3..3352cbc8b1e1 100644 --- a/pkgs/development/python-modules/google_cloud_automl/default.nix +++ b/pkgs/development/python-modules/google_cloud_automl/default.nix @@ -1,6 +1,16 @@ -{ stdenv, buildPythonPackage, fetchPypi, pythonOlder, pytestCheckHook, libcst -, google_api_core, google_cloud_storage, google_cloud_testutils, pandas -, proto-plus, pytest-asyncio, mock }: +{ stdenv +, buildPythonPackage +, fetchPypi +, pytestCheckHook +, libcst +, google_api_core +, google_cloud_storage +, google_cloud_testutils +, pandas +, proto-plus +, pytest-asyncio +, mock +}: buildPythonPackage rec { pname = "google-cloud-automl"; @@ -11,7 +21,7 @@ buildPythonPackage rec { sha256 = "520dfe2ee04d28f3088c9c582fa2a534fc272647d5e2e59acc903c0152e61696"; }; - disabled = pythonOlder "3.6"; + propagatedBuildInputs = [ google_api_core libcst proto-plus ]; checkInputs = [ google_cloud_storage @@ -21,19 +31,29 @@ buildPythonPackage rec { pytest-asyncio pytestCheckHook ]; - propagatedBuildInputs = [ google_api_core libcst proto-plus ]; - # ignore tests which need credentials - disabledTests = [ "test_prediction_client_client_info" ]; preCheck = '' + # do not shadow imports rm -r google + # requires credentials rm tests/system/gapic/v1beta1/test_system_tables_client_v1.py ''; + disabledTests = [ + # requires credentials + "test_prediction_client_client_info" + ]; + + pythonImportsCheck = [ + "google.cloud.automl" + "google.cloud.automl_v1" + "google.cloud.automl_v1beta1" + ]; + meta = with stdenv.lib; { description = "Cloud AutoML API client library"; homepage = "https://github.com/googleapis/python-automl"; license = licenses.asl20; - maintainers = [ maintainers.costrouc ]; + maintainers = with maintainers; [ SuperSandro2000 ]; }; }