1{ lib
2, buildPythonPackage
3, fetchPypi
4, grpc_google_iam_v1
5, google-cloud-core
6, google-cloud-testutils
7, libcst
8, mock
9, proto-plus
10, pytestCheckHook
11, pytest-asyncio
12, sqlparse
13}:
14
15buildPythonPackage rec {
16 pname = "google-cloud-spanner";
17 version = "3.3.0";
18
19 src = fetchPypi {
20 inherit pname version;
21 sha256 = "sha256-XnOCmxQ6YCO1C7RYHzcZY4ihrt2KommWTkTD9y+B5tg=";
22 };
23
24 propagatedBuildInputs = [ google-cloud-core grpc_google_iam_v1 libcst proto-plus sqlparse ];
25
26 checkInputs = [ google-cloud-testutils mock pytestCheckHook pytest-asyncio ];
27
28 preCheck = ''
29 # prevent google directory from shadowing google imports
30 rm -r google
31 # disable tests which require credentials
32 rm tests/system/test_{system,system_dbapi}.py
33 rm tests/unit/spanner_dbapi/test_{connect,connection,cursor}.py
34 '';
35
36 pythonImportsCheck = [
37 "google.cloud.spanner_admin_database_v1"
38 "google.cloud.spanner_admin_instance_v1"
39 "google.cloud.spanner_dbapi"
40 "google.cloud.spanner_v1"
41 ];
42
43 meta = with lib; {
44 description = "Cloud Spanner API client library";
45 homepage = "https://github.com/googleapis/python-spanner";
46 license = licenses.asl20;
47 maintainers = with maintainers; [ SuperSandro2000 ];
48 };
49}