nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
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 setuptools,
16}:
17
18buildPythonPackage rec {
19 pname = "google-cloud-automl";
20 version = "2.18.0";
21 pyproject = true;
22
23 src = fetchPypi {
24 pname = "google_cloud_automl";
25 inherit version;
26 hash = "sha256-F9JU0usvIFAxWQem49LpoD4KbJ+yaq1akoCJ7qUhRXI=";
27 };
28
29 build-system = [ setuptools ];
30
31 dependencies = [
32 google-api-core
33 proto-plus
34 protobuf
35 ]
36 ++ google-api-core.optional-dependencies.grpc;
37
38 optional-dependencies = {
39 libcst = [ libcst ];
40 pandas = [ pandas ];
41 storage = [ google-cloud-storage ];
42 };
43
44 nativeCheckInputs = [
45 google-cloud-storage
46 google-cloud-testutils
47 mock
48 pandas
49 pytest-asyncio
50 pytestCheckHook
51 ];
52
53 preCheck = ''
54 # do not shadow imports
55 rm -r google
56 '';
57
58 disabledTests = [
59 # Test requires credentials
60 "test_prediction_client_client_info"
61 # Test requires project ID
62 "test_list_models"
63 ];
64
65 pythonImportsCheck = [
66 "google.cloud.automl"
67 "google.cloud.automl_v1"
68 "google.cloud.automl_v1beta1"
69 ];
70
71 meta = {
72 description = "Cloud AutoML API client library";
73 homepage = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-automl";
74 changelog = "https://github.com/googleapis/google-cloud-python/tree/google-cloud-automl-v${version}/packages/google-cloud-automl";
75 license = lib.licenses.asl20;
76 maintainers = [ ];
77 };
78}