1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 google-api-core,
6 google-cloud-storage,
7 google-cloud-testutils,
8 libcst,
9 mock,
10 pandas,
11 proto-plus,
12 protobuf,
13 pytest-asyncio,
14 pytestCheckHook,
15 pythonOlder,
16 setuptools,
17}:
18
19buildPythonPackage rec {
20 pname = "google-cloud-automl";
21 version = "2.13.3";
22 pyproject = true;
23
24 disabled = pythonOlder "3.7";
25
26 src = fetchPypi {
27 inherit pname version;
28 hash = "sha256-iRqQgurt6xe8W7ck/BULdwLGhNdCD58irj98X8YRxxo=";
29 };
30
31 nativeBuildInputs = [ setuptools ];
32
33 propagatedBuildInputs = [
34 google-api-core
35 proto-plus
36 protobuf
37 ] ++ google-api-core.optional-dependencies.grpc;
38
39 passthru.optional-dependencies = {
40 libcst = [ libcst ];
41 pandas = [ pandas ];
42 storage = [ google-cloud-storage ];
43 };
44
45 nativeCheckInputs = [
46 google-cloud-storage
47 google-cloud-testutils
48 mock
49 pandas
50 pytest-asyncio
51 pytestCheckHook
52 ];
53
54 preCheck = ''
55 # do not shadow imports
56 rm -r google
57 '';
58
59 disabledTests = [
60 # Test requires credentials
61 "test_prediction_client_client_info"
62 # Test requires project ID
63 "test_list_models"
64 ];
65
66 pythonImportsCheck = [
67 "google.cloud.automl"
68 "google.cloud.automl_v1"
69 "google.cloud.automl_v1beta1"
70 ];
71
72 meta = with lib; {
73 description = "Cloud AutoML API client library";
74 homepage = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-automl";
75 changelog = "https://github.com/googleapis/google-cloud-python/tree/google-cloud-automl-v${version}/packages/google-cloud-automl";
76 license = licenses.asl20;
77 maintainers = with maintainers; [ ];
78 };
79}