Skip to content

Commit fdbdc74

Browse files
chore: Re-generated to pick up changes from synthtool. (#98)
* changes without context autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters. * fix: address lint issues Source-Author: Leah E. Cole <6719667+leahecole@users.noreply.github.com> Source-Date: Thu Nov 12 11:30:49 2020 -0800 Source-Repo: googleapis/synthtool Source-Sha: e89175cf074dccc4babb4eca66ae913696e47a71 Source-Link: googleapis/synthtool@e89175c * docs(python): update intersphinx for grpc and auth * docs(python): update intersphinx for grpc and auth * use https for python intersphinx Co-authored-by: Tim Swast <swast@google.com> Source-Author: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Source-Date: Wed Nov 18 14:37:25 2020 -0700 Source-Repo: googleapis/synthtool Source-Sha: 9a7d9fbb7045c34c9d3d22c1ff766eeae51f04c9 Source-Link: googleapis/synthtool@9a7d9fb * docs(python): fix intersphinx link for google-auth Source-Author: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Source-Date: Thu Nov 19 10:16:05 2020 -0700 Source-Repo: googleapis/synthtool Source-Sha: a073c873f3928c561bdf87fdfbf1d081d1998984 Source-Link: googleapis/synthtool@a073c87
1 parent ad87fc0 commit fdbdc74

File tree

2 files changed

+35
-20
lines changed

2 files changed

+35
-20
lines changed

logging/samples/snippets/README.rst

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
.. This file is automatically generated. Do not edit this file directly.
23
34
Cloud Logging Python Samples
@@ -19,6 +20,7 @@ Setup
1920
-------------------------------------------------------------------------------
2021

2122

23+
2224
Authentication
2325
++++++++++++++
2426

@@ -30,14 +32,16 @@ credentials for applications.
3032
https://cloud.google.com/docs/authentication/getting-started
3133

3234

35+
36+
3337
Install Dependencies
3438
++++++++++++++++++++
3539

36-
#. Clone python-logging and change directory to the sample directory you want to use.
40+
#. Clone python-docs-samples and change directory to the sample directory you want to use.
3741

3842
.. code-block:: bash
3943
40-
$ git clone https://github.com/googleapis/python-logging.git
44+
$ git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git
4145
4246
#. Install `pip`_ and `virtualenv`_ if you do not already have them. You may want to refer to the `Python Development Environment Setup Guide`_ for Google Cloud Platform for instructions.
4347

@@ -61,6 +65,10 @@ Install Dependencies
6165
.. _virtualenv: https://virtualenv.pypa.io/
6266

6367

68+
69+
70+
71+
6472
Samples
6573
-------------------------------------------------------------------------------
6674

@@ -82,6 +90,7 @@ To run this sample:
8290
8391
8492
93+
8594
Snippets
8695
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
8796

@@ -120,6 +129,7 @@ To run this sample:
120129
121130
122131
132+
123133
Export
124134
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
125135

@@ -158,6 +168,10 @@ To run this sample:
158168
159169
160170
171+
172+
173+
174+
161175
The client library
162176
-------------------------------------------------------------------------------
163177
@@ -173,4 +187,5 @@ to `browse the source`_ and `report issues`_.
173187
https://github.com/GoogleCloudPlatform/google-cloud-python/issues
174188
175189
176-
.. _Google Cloud SDK: https://cloud.google.com/sdk/
190+
191+
.. _Google Cloud SDK: https://cloud.google.com/sdk/

logging/samples/snippets/noxfile.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -37,25 +37,28 @@
3737

3838
TEST_CONFIG = {
3939
# You can opt out from the test for specific Python versions.
40-
"ignored_versions": ["2.7"],
40+
'ignored_versions': ["2.7"],
41+
4142
# Old samples are opted out of enforcing Python type hints
4243
# All new samples should feature them
43-
"enforce_type_hints": False,
44+
'enforce_type_hints': False,
45+
4446
# An envvar key for determining the project id to use. Change it
4547
# to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a
4648
# build specific Cloud project. You can also use your own string
4749
# to use your own Cloud project.
48-
"gcloud_project_env": "GOOGLE_CLOUD_PROJECT",
50+
'gcloud_project_env': 'GOOGLE_CLOUD_PROJECT',
4951
# 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT',
52+
5053
# A dictionary you want to inject into your test. Don't put any
5154
# secrets here. These values will override predefined values.
52-
"envs": {},
55+
'envs': {},
5356
}
5457

5558

5659
try:
5760
# Ensure we can import noxfile_config in the project's directory.
58-
sys.path.append(".")
61+
sys.path.append('.')
5962
from noxfile_config import TEST_CONFIG_OVERRIDE
6063
except ImportError as e:
6164
print("No user noxfile_config found: detail: {}".format(e))
@@ -70,12 +73,12 @@ def get_pytest_env_vars():
7073
ret = {}
7174

7275
# Override the GCLOUD_PROJECT and the alias.
73-
env_key = TEST_CONFIG["gcloud_project_env"]
76+
env_key = TEST_CONFIG['gcloud_project_env']
7477
# This should error out if not set.
75-
ret["GOOGLE_CLOUD_PROJECT"] = os.environ[env_key]
78+
ret['GOOGLE_CLOUD_PROJECT'] = os.environ[env_key]
7679

7780
# Apply user supplied envs.
78-
ret.update(TEST_CONFIG["envs"])
81+
ret.update(TEST_CONFIG['envs'])
7982
return ret
8083

8184

@@ -84,7 +87,7 @@ def get_pytest_env_vars():
8487
ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8"]
8588

8689
# Any default versions that should be ignored.
87-
IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"]
90+
IGNORED_VERSIONS = TEST_CONFIG['ignored_versions']
8891

8992
TESTED_VERSIONS = sorted([v for v in ALL_VERSIONS if v not in IGNORED_VERSIONS])
9093

@@ -133,7 +136,7 @@ def _determine_local_import_names(start_dir):
133136

134137
@nox.session
135138
def lint(session):
136-
if not TEST_CONFIG["enforce_type_hints"]:
139+
if not TEST_CONFIG['enforce_type_hints']:
137140
session.install("flake8", "flake8-import-order")
138141
else:
139142
session.install("flake8", "flake8-import-order", "flake8-annotations")
@@ -142,11 +145,9 @@ def lint(session):
142145
args = FLAKE8_COMMON_ARGS + [
143146
"--application-import-names",
144147
",".join(local_names),
145-
".",
148+
"."
146149
]
147150
session.run("flake8", *args)
148-
149-
150151
#
151152
# Black
152153
#
@@ -159,7 +160,6 @@ def blacken(session):
159160

160161
session.run("black", *python_files)
161162

162-
163163
#
164164
# Sample Tests
165165
#
@@ -199,9 +199,9 @@ def py(session):
199199
if session.python in TESTED_VERSIONS:
200200
_session_tests(session)
201201
else:
202-
session.skip(
203-
"SKIPPED: {} tests are disabled for this sample.".format(session.python)
204-
)
202+
session.skip("SKIPPED: {} tests are disabled for this sample.".format(
203+
session.python
204+
))
205205

206206

207207
#

0 commit comments

Comments
 (0)