1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 google-api-core,
6 proto-plus,
7 protobuf,
8 pytest-asyncio,
9 pytestCheckHook,
10 pythonOlder,
11 setuptools,
12}:
13
14buildPythonPackage rec {
15 pname = "google-cloud-org-policy";
16 version = "1.14.0";
17 pyproject = true;
18
19 disabled = pythonOlder "3.7";
20
21 src = fetchPypi {
22 pname = "google_cloud_org_policy";
23 inherit version;
24 hash = "sha256-TId9QgosUStFTmLqzSVXy7x09zTAeZRuMOYfYnkbMZw=";
25 };
26
27 build-system = [ setuptools ];
28
29 dependencies = [
30 google-api-core
31 proto-plus
32 protobuf
33 ] ++ google-api-core.optional-dependencies.grpc;
34
35 nativeCheckInputs = [
36 pytest-asyncio
37 pytestCheckHook
38 ];
39
40 # Prevent google directory from shadowing google imports
41 preCheck = ''
42 rm -r google
43 '';
44
45 pythonImportsCheck = [ "google.cloud.orgpolicy" ];
46
47 meta = with lib; {
48 description = "Protobufs for Google Cloud Organization Policy";
49 homepage = "https://github.com/googleapis/python-org-policy";
50 changelog = "https://github.com/googleapis/python-org-policy/blob/v${version}/CHANGELOG.md";
51 license = licenses.asl20;
52 maintainers = with maintainers; [ austinbutler ];
53 };
54}