From ca7f003324f81087b2b0e0a7bf1e8905fd0fed34 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 29 Jan 2020 18:50:26 -0800 Subject: [PATCH] fix(oslogin): add py2 deprecation warning; bump copyright year to 2020; add 3.8 unit tests (via synth) (#10071) * [CHANGE ME] Re-generated oslogin to pick up changes in the API or client library generator. * chore: regen Co-authored-by: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> --- oslogin/docs/_static/custom.css | 2 +- oslogin/docs/_templates/layout.html | 1 + oslogin/google/__init__.py | 2 +- oslogin/google/cloud/__init__.py | 2 +- oslogin/google/cloud/oslogin.py | 2 +- oslogin/google/cloud/oslogin_v1/__init__.py | 13 ++- .../google/cloud/oslogin_v1/gapic/enums.py | 2 +- .../gapic/os_login_service_client.py | 2 +- .../os_login_service_grpc_transport.py | 2 +- .../cloud/oslogin_v1/proto/common_pb2.py | 6 +- .../cloud/oslogin_v1/proto/oslogin_pb2.py | 8 +- oslogin/google/cloud/oslogin_v1/types.py | 2 +- oslogin/noxfile.py | 2 +- oslogin/synth.metadata | 101 ++++++++++++++++-- oslogin/synth.py | 2 +- .../v1/test_os_login_service_client_v1.py | 2 +- 16 files changed, 127 insertions(+), 24 deletions(-) diff --git a/oslogin/docs/_static/custom.css b/oslogin/docs/_static/custom.css index 9a6f9f8ddc3a..0abaf229fce3 100644 --- a/oslogin/docs/_static/custom.css +++ b/oslogin/docs/_static/custom.css @@ -1,4 +1,4 @@ div#python2-eol { border-color: red; border-width: medium; -} \ No newline at end of file +} \ No newline at end of file diff --git a/oslogin/docs/_templates/layout.html b/oslogin/docs/_templates/layout.html index de457b2c2767..228529efe2d2 100644 --- a/oslogin/docs/_templates/layout.html +++ b/oslogin/docs/_templates/layout.html @@ -1,3 +1,4 @@ + {% extends "!layout.html" %} {%- block content %} {%- if theme_fixed_sidebar|lower == 'true' %} diff --git a/oslogin/google/__init__.py b/oslogin/google/__init__.py index 8fcc60e2b9c6..9a1b64a6d586 100644 --- a/oslogin/google/__init__.py +++ b/oslogin/google/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright 2019 Google LLC +# 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. diff --git a/oslogin/google/cloud/__init__.py b/oslogin/google/cloud/__init__.py index 8fcc60e2b9c6..9a1b64a6d586 100644 --- a/oslogin/google/cloud/__init__.py +++ b/oslogin/google/cloud/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright 2019 Google LLC +# 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. diff --git a/oslogin/google/cloud/oslogin.py b/oslogin/google/cloud/oslogin.py index 416aad010a9b..8e9daac48e16 100644 --- a/oslogin/google/cloud/oslogin.py +++ b/oslogin/google/cloud/oslogin.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright 2019 Google LLC +# 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. diff --git a/oslogin/google/cloud/oslogin_v1/__init__.py b/oslogin/google/cloud/oslogin_v1/__init__.py index 83a5ac263537..24017b9784ca 100644 --- a/oslogin/google/cloud/oslogin_v1/__init__.py +++ b/oslogin/google/cloud/oslogin_v1/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright 2019 Google LLC +# 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. @@ -16,12 +16,23 @@ from __future__ import absolute_import +import sys +import warnings from google.cloud.oslogin_v1 import types from google.cloud.oslogin_v1.gapic import enums from google.cloud.oslogin_v1.gapic import os_login_service_client +if sys.version_info[:2] == (2, 7): + message = ( + "A future version of this library will drop support for Python 2.7." + "More details about Python 2 support for Google Cloud Client Libraries" + "can be found at https://cloud.google.com/python/docs/python2-sunset/" + ) + warnings.warn(message, DeprecationWarning) + + class OsLoginServiceClient(os_login_service_client.OsLoginServiceClient): __doc__ = os_login_service_client.OsLoginServiceClient.__doc__ enums = enums diff --git a/oslogin/google/cloud/oslogin_v1/gapic/enums.py b/oslogin/google/cloud/oslogin_v1/gapic/enums.py index ab555b005071..48c48da09224 100644 --- a/oslogin/google/cloud/oslogin_v1/gapic/enums.py +++ b/oslogin/google/cloud/oslogin_v1/gapic/enums.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright 2019 Google LLC +# 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. diff --git a/oslogin/google/cloud/oslogin_v1/gapic/os_login_service_client.py b/oslogin/google/cloud/oslogin_v1/gapic/os_login_service_client.py index ec496c53a918..e4abdbd8acec 100644 --- a/oslogin/google/cloud/oslogin_v1/gapic/os_login_service_client.py +++ b/oslogin/google/cloud/oslogin_v1/gapic/os_login_service_client.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright 2019 Google LLC +# 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. diff --git a/oslogin/google/cloud/oslogin_v1/gapic/transports/os_login_service_grpc_transport.py b/oslogin/google/cloud/oslogin_v1/gapic/transports/os_login_service_grpc_transport.py index 2860dfe42952..ff1db19048e2 100644 --- a/oslogin/google/cloud/oslogin_v1/gapic/transports/os_login_service_grpc_transport.py +++ b/oslogin/google/cloud/oslogin_v1/gapic/transports/os_login_service_grpc_transport.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright 2019 Google LLC +# 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. diff --git a/oslogin/google/cloud/oslogin_v1/proto/common_pb2.py b/oslogin/google/cloud/oslogin_v1/proto/common_pb2.py index c842ef79bc1d..7f53f0bd3099 100644 --- a/oslogin/google/cloud/oslogin_v1/proto/common_pb2.py +++ b/oslogin/google/cloud/oslogin_v1/proto/common_pb2.py @@ -396,7 +396,8 @@ dict( DESCRIPTOR=_POSIXACCOUNT, __module__="google.cloud.oslogin.common.common_pb2", - __doc__="""The POSIX account information associated with a Google account. + __doc__="""The POSIX account information associated with a Google + account. Attributes: @@ -435,7 +436,8 @@ dict( DESCRIPTOR=_SSHPUBLICKEY, __module__="google.cloud.oslogin.common.common_pb2", - __doc__="""The SSH public key information associated with a Google account. + __doc__="""The SSH public key information associated with a Google + account. Attributes: diff --git a/oslogin/google/cloud/oslogin_v1/proto/oslogin_pb2.py b/oslogin/google/cloud/oslogin_v1/proto/oslogin_pb2.py index 0feaf4be9ae9..685f9891dc7a 100644 --- a/oslogin/google/cloud/oslogin_v1/proto/oslogin_pb2.py +++ b/oslogin/google/cloud/oslogin_v1/proto/oslogin_pb2.py @@ -626,8 +626,8 @@ ), DESCRIPTOR=_LOGINPROFILE, __module__="google.cloud.oslogin_v1.proto.oslogin_pb2", - __doc__="""The user profile information used for logging in to a virtual machine on - Google Compute Engine. + __doc__="""The user profile information used for logging in to a + virtual machine on Google Compute Engine. Attributes: @@ -693,8 +693,8 @@ dict( DESCRIPTOR=_GETLOGINPROFILEREQUEST, __module__="google.cloud.oslogin_v1.proto.oslogin_pb2", - __doc__="""A request message for retrieving the login profile information for a - user. + __doc__="""A request message for retrieving the login profile + information for a user. Attributes: diff --git a/oslogin/google/cloud/oslogin_v1/types.py b/oslogin/google/cloud/oslogin_v1/types.py index 44770325b204..7a4c50766e11 100644 --- a/oslogin/google/cloud/oslogin_v1/types.py +++ b/oslogin/google/cloud/oslogin_v1/types.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright 2019 Google LLC +# 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. diff --git a/oslogin/noxfile.py b/oslogin/noxfile.py index a2eefbb6765f..7949a4e3925a 100644 --- a/oslogin/noxfile.py +++ b/oslogin/noxfile.py @@ -86,7 +86,7 @@ def default(session): ) -@nox.session(python=["2.7", "3.5", "3.6", "3.7"]) +@nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8"]) def unit(session): """Run the unit test suite.""" default(session) diff --git a/oslogin/synth.metadata b/oslogin/synth.metadata index fe8ff68182ff..f2eb39123f06 100644 --- a/oslogin/synth.metadata +++ b/oslogin/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-11-07T00:17:37.354583Z", + "updateTime": "2020-01-30T02:35:03.193416Z", "sources": [ { "generator": { "name": "artman", - "version": "0.41.0", - "dockerImage": "googleapis/artman@sha256:75b38a3b073a7b243545f2332463096624c802bb1e56b8cb6f22ba1ecd325fa9" + "version": "0.44.4", + "dockerImage": "googleapis/artman@sha256:19e945954fc960a4bdfee6cb34695898ab21a8cf0bac063ee39b91f00a1faec8" } }, { "git": { "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "2275670a746ab2bc03ebba0d914b45320ea15af4", - "internalRef": "278922329" + "remote": "git@github.com:googleapis/googleapis.git", + "sha": "b491d07cadaae7cde5608321f913e5ca1459b32d", + "internalRef": "292245373" } }, { @@ -35,5 +35,94 @@ "config": "google/cloud/oslogin/artman_oslogin_v1.yaml" } } + ], + "newFiles": [ + { + "path": "MANIFEST.in" + }, + { + "path": ".flake8" + }, + { + "path": "noxfile.py" + }, + { + "path": ".coveragerc" + }, + { + "path": "setup.cfg" + }, + { + "path": "LICENSE" + }, + { + "path": "docs/conf.py" + }, + { + "path": "docs/_static/custom.css" + }, + { + "path": "docs/gapic/v1/api.rst" + }, + { + "path": "docs/gapic/v1/types.rst" + }, + { + "path": "docs/_templates/layout.html" + }, + { + "path": "google/__init__.py" + }, + { + "path": "google/cloud/__init__.py" + }, + { + "path": "google/cloud/oslogin.py" + }, + { + "path": "google/cloud/oslogin_v1/types.py" + }, + { + "path": "google/cloud/oslogin_v1/__init__.py" + }, + { + "path": "google/cloud/oslogin_v1/gapic/__init__.py" + }, + { + "path": "google/cloud/oslogin_v1/gapic/os_login_service_client.py" + }, + { + "path": "google/cloud/oslogin_v1/gapic/os_login_service_client_config.py" + }, + { + "path": "google/cloud/oslogin_v1/gapic/enums.py" + }, + { + "path": "google/cloud/oslogin_v1/gapic/transports/__init__.py" + }, + { + "path": "google/cloud/oslogin_v1/gapic/transports/os_login_service_grpc_transport.py" + }, + { + "path": "google/cloud/oslogin_v1/proto/oslogin.proto" + }, + { + "path": "google/cloud/oslogin_v1/proto/oslogin_pb2_grpc.py" + }, + { + "path": "google/cloud/oslogin_v1/proto/__init__.py" + }, + { + "path": "google/cloud/oslogin_v1/proto/common_pb2.py" + }, + { + "path": "google/cloud/oslogin_v1/proto/common_pb2_grpc.py" + }, + { + "path": "google/cloud/oslogin_v1/proto/oslogin_pb2.py" + }, + { + "path": "tests/unit/gapic/v1/test_os_login_service_client_v1.py" + } ] } \ No newline at end of file diff --git a/oslogin/synth.py b/oslogin/synth.py index 9a668a6c1066..792875c2c5a7 100644 --- a/oslogin/synth.py +++ b/oslogin/synth.py @@ -41,7 +41,7 @@ library / "google/cloud/oslogin_v1/proto/oslogin_v1/**", ], ) -s.move(library / "google/cloud/oslogin_v1/proto/**/*", "google/cloud/oslogin_v1/proto") +s.move(library / "google/cloud/oslogin_v1/proto/**/*.py", "google/cloud/oslogin_v1/proto") # Fix up imports diff --git a/oslogin/tests/unit/gapic/v1/test_os_login_service_client_v1.py b/oslogin/tests/unit/gapic/v1/test_os_login_service_client_v1.py index a912a5780d3a..66fae902ae7d 100644 --- a/oslogin/tests/unit/gapic/v1/test_os_login_service_client_v1.py +++ b/oslogin/tests/unit/gapic/v1/test_os_login_service_client_v1.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright 2019 Google LLC +# 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.