1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 google-api-core,
6 google-cloud-core,
7 google-cloud-testutils,
8 mock,
9 proto-plus,
10 protobuf,
11 pytest-asyncio,
12 pytestCheckHook,
13 pythonOlder,
14 setuptools,
15}:
16
17buildPythonPackage rec {
18 pname = "google-cloud-translate";
19 version = "3.15.3";
20 pyproject = true;
21
22 disabled = pythonOlder "3.7";
23
24 src = fetchPypi {
25 inherit pname version;
26 hash = "sha256-7Vh6HmDPhHw7Gt1rKCVuLRci+nOkKFM09excqTPmFvI=";
27 };
28
29 nativeBuildInputs = [ setuptools ];
30
31 propagatedBuildInputs = [
32 google-api-core
33 google-cloud-core
34 proto-plus
35 protobuf
36 ] ++ google-api-core.optional-dependencies.grpc;
37
38 nativeCheckInputs = [
39 google-cloud-testutils
40 mock
41 pytest-asyncio
42 pytestCheckHook
43 ];
44
45 preCheck = ''
46 # prevent shadowing imports
47 rm -r google
48 '';
49
50 pythonImportsCheck = [
51 "google.cloud.translate"
52 "google.cloud.translate_v2"
53 "google.cloud.translate_v3"
54 "google.cloud.translate_v3beta1"
55 ];
56
57 disabledTests = [
58 # Tests require PROJECT_ID
59 "test_list_glossaries"
60 ];
61
62 meta = with lib; {
63 description = "Google Cloud Translation API client library";
64 homepage = "https://github.com/googleapis/python-translate";
65 changelog = "https://github.com/googleapis/python-translate/blob/v${version}/CHANGELOG.md";
66 license = licenses.asl20;
67 maintainers = with maintainers; [ ];
68 };
69}