From b77948785c85b9120b19d8d3f5baf008380f8d3b Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Wed, 6 Apr 2022 14:25:12 +0000 Subject: [PATCH] chore: add license headers --- .github/auto-label.yaml | 13 +++++++++++ google/__init__.py | 14 ++++++++++++ google/iam/__init__.py | 14 ++++++++++++ google/iam/v1/__init__.py | 13 +++++++++++ google/iam/v1/iam_policy_pb2.py | 15 +++++++++++++ google/iam/v1/iam_policy_pb2_grpc.py | 15 +++++++++++++ google/iam/v1/logging/audit_data_pb2.py | 15 +++++++++++++ google/iam/v1/options_pb2.py | 15 +++++++++++++ google/iam/v1/options_pb2_grpc.py | 15 +++++++++++++ google/iam/v1/policy_pb2.py | 15 +++++++++++++ google/iam/v1/policy_pb2_grpc.py | 15 +++++++++++++ owlbot.py | 29 ++++++++++++++++++++++++- 12 files changed, 187 insertions(+), 1 deletion(-) diff --git a/.github/auto-label.yaml b/.github/auto-label.yaml index 09c8d73..41bff0b 100644 --- a/.github/auto-label.yaml +++ b/.github/auto-label.yaml @@ -1,2 +1,15 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. requestsize: enabled: true diff --git a/google/__init__.py b/google/__init__.py index 5284146..ad1e9d1 100644 --- a/google/__init__.py +++ b/google/__init__.py @@ -1 +1,15 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + __import__("pkg_resources").declare_namespace(__name__) diff --git a/google/iam/__init__.py b/google/iam/__init__.py index 5284146..ad1e9d1 100644 --- a/google/iam/__init__.py +++ b/google/iam/__init__.py @@ -1 +1,15 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + __import__("pkg_resources").declare_namespace(__name__) diff --git a/google/iam/v1/__init__.py b/google/iam/v1/__init__.py index e69de29..b19ac07 100644 --- a/google/iam/v1/__init__.py +++ b/google/iam/v1/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. \ No newline at end of file diff --git a/google/iam/v1/iam_policy_pb2.py b/google/iam/v1/iam_policy_pb2.py index da8e40d..2a05ba8 100644 --- a/google/iam/v1/iam_policy_pb2.py +++ b/google/iam/v1/iam_policy_pb2.py @@ -1,4 +1,19 @@ # -*- coding: utf-8 -*- + +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/iam/v1/iam_policy.proto """Generated protocol buffer code.""" diff --git a/google/iam/v1/iam_policy_pb2_grpc.py b/google/iam/v1/iam_policy_pb2_grpc.py index 96f11ff..175a16f 100644 --- a/google/iam/v1/iam_policy_pb2_grpc.py +++ b/google/iam/v1/iam_policy_pb2_grpc.py @@ -1,4 +1,19 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! + import grpc from google.iam.v1 import iam_policy_pb2 as google_dot_iam_dot_v1_dot_iam__policy__pb2 diff --git a/google/iam/v1/logging/audit_data_pb2.py b/google/iam/v1/logging/audit_data_pb2.py index ca68a2a..a6db6e2 100644 --- a/google/iam/v1/logging/audit_data_pb2.py +++ b/google/iam/v1/logging/audit_data_pb2.py @@ -1,4 +1,19 @@ # -*- coding: utf-8 -*- + +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/iam/v1/logging/audit_data.proto """Generated protocol buffer code.""" diff --git a/google/iam/v1/options_pb2.py b/google/iam/v1/options_pb2.py index c18ce83..21ef36e 100644 --- a/google/iam/v1/options_pb2.py +++ b/google/iam/v1/options_pb2.py @@ -1,4 +1,19 @@ # -*- coding: utf-8 -*- + +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/iam/v1/options.proto """Generated protocol buffer code.""" diff --git a/google/iam/v1/options_pb2_grpc.py b/google/iam/v1/options_pb2_grpc.py index 07cb78f..3f8ebac 100644 --- a/google/iam/v1/options_pb2_grpc.py +++ b/google/iam/v1/options_pb2_grpc.py @@ -1,2 +1,17 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! + import grpc diff --git a/google/iam/v1/policy_pb2.py b/google/iam/v1/policy_pb2.py index 61f9d98..fd9a007 100644 --- a/google/iam/v1/policy_pb2.py +++ b/google/iam/v1/policy_pb2.py @@ -1,4 +1,19 @@ # -*- coding: utf-8 -*- + +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/iam/v1/policy.proto """Generated protocol buffer code.""" diff --git a/google/iam/v1/policy_pb2_grpc.py b/google/iam/v1/policy_pb2_grpc.py index 07cb78f..3f8ebac 100644 --- a/google/iam/v1/policy_pb2_grpc.py +++ b/google/iam/v1/policy_pb2_grpc.py @@ -1,2 +1,17 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! + import grpc diff --git a/owlbot.py b/owlbot.py index ab35a19..213918a 100644 --- a/owlbot.py +++ b/owlbot.py @@ -63,8 +63,35 @@ # Clean up google/type shutil.rmtree('google/type') +# Add license headers +python.fix_pb2_headers() + +LICENSE = """ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License.""" + +PB2_GRPC_HEADER = r"""(\# Generated by the gRPC Python protocol compiler plugin\. DO NOT EDIT!$) +(.*?$)""" + +s.replace( + "**/*_pb2_grpc.py", + PB2_GRPC_HEADER, + fr"{LICENSE}\n\n\g<1>\n\n\g<2>", # add line breaks to avoid stacking replacements +) + # ---------------------------------------------------------------------------- # Run blacken session # ---------------------------------------------------------------------------- -s.shell.run(["nox", "-s", "blacken"], hide_output=False) \ No newline at end of file +s.shell.run(["nox", "-s", "blacken"], hide_output=False)