Skip to content

Commit 09feb3a

Browse files
authored
chore: add samples to microgen (#89)
1 parent a07974b commit 09feb3a

31 files changed

+1299
-69
lines changed

.coveragerc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
# Generated by synthtool. DO NOT EDIT!
1818
[run]
1919
branch = True
20+
omit =
21+
google/cloud/__init__.py
2022

2123
[report]
2224
fail_under = 100
@@ -32,4 +34,5 @@ omit =
3234
*/gapic/*.py
3335
*/proto/*.py
3436
*/core/*.py
35-
*/site-packages/*.py
37+
*/site-packages/*.py
38+
google/cloud/__init__.py

.flake8

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ exclude =
2121
# Exclude generated code.
2222
**/proto/**
2323
**/gapic/**
24+
**/services/**
25+
**/types/**
2426
*_pb2.py
2527

2628
# Standard linting exemptions.

.github/snippet-bot.yml

Whitespace-only changes.

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
dist
1111
build
1212
eggs
13+
.eggs
1314
parts
1415
bin
1516
var
@@ -45,14 +46,16 @@ pip-log.txt
4546
# Built documentation
4647
docs/_build
4748
bigquery/docs/generated
49+
docs.metadata
4850

4951
# Virtual environment
5052
env/
5153
coverage.xml
54+
sponge_log.xml
5255

5356
# System test environment variables.
5457
system_tests/local_test_setup
5558

5659
# Make sure a generated file isn't accidentally committed.
5760
pylintrc
58-
pylintrc.test
61+
pylintrc.test

.kokoro/populate-secrets.sh

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/bash
2+
# Copyright 2020 Google LLC.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
set -eo pipefail
17+
18+
function now { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n' ;}
19+
function msg { println "$*" >&2 ;}
20+
function println { printf '%s\n' "$(now) $*" ;}
21+
22+
23+
# Populates requested secrets set in SECRET_MANAGER_KEYS from service account:
24+
# kokoro-trampoline@cloud-devrel-kokoro-resources.iam.gserviceaccount.com
25+
SECRET_LOCATION="${KOKORO_GFILE_DIR}/secret_manager"
26+
msg "Creating folder on disk for secrets: ${SECRET_LOCATION}"
27+
mkdir -p ${SECRET_LOCATION}
28+
for key in $(echo ${SECRET_MANAGER_KEYS} | sed "s/,/ /g")
29+
do
30+
msg "Retrieving secret ${key}"
31+
docker run --entrypoint=gcloud \
32+
--volume=${KOKORO_GFILE_DIR}:${KOKORO_GFILE_DIR} \
33+
gcr.io/google.com/cloudsdktool/cloud-sdk \
34+
secrets versions access latest \
35+
--project cloud-devrel-kokoro-resources \
36+
--secret ${key} > \
37+
"${SECRET_LOCATION}/${key}"
38+
if [[ $? == 0 ]]; then
39+
msg "Secret written to ${SECRET_LOCATION}/${key}"
40+
else
41+
msg "Error retrieving secret ${key}"
42+
fi
43+
done

CONTRIBUTING.rst

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -80,25 +80,6 @@ We use `nox <https://nox.readthedocs.io/en/latest/>`__ to instrument our tests.
8080

8181
.. nox: https://pypi.org/project/nox/
8282
83-
Note on Editable Installs / Develop Mode
84-
========================================
85-
86-
- As mentioned previously, using ``setuptools`` in `develop mode`_
87-
or a ``pip`` `editable install`_ is not possible with this
88-
library. This is because this library uses `namespace packages`_.
89-
For context see `Issue #2316`_ and the relevant `PyPA issue`_.
90-
91-
Since ``editable`` / ``develop`` mode can't be used, packages
92-
need to be installed directly. Hence your changes to the source
93-
tree don't get incorporated into the **already installed**
94-
package.
95-
96-
.. _namespace packages: https://www.python.org/dev/peps/pep-0420/
97-
.. _Issue #2316: https://github.com/GoogleCloudPlatform/google-cloud-python/issues/2316
98-
.. _PyPA issue: https://github.com/pypa/packaging-problems/issues/12
99-
.. _develop mode: https://setuptools.readthedocs.io/en/latest/setuptools.html#development-mode
100-
.. _editable install: https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs
101-
10283
*****************************************
10384
I'm getting weird errors... Can you help?
10485
*****************************************

MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@ recursive-include google *.json *.proto
2020
recursive-include tests *
2121
global-exclude *.py[co]
2222
global-exclude __pycache__
23+
24+
# Exclude scripts for samples readmegen
25+
prune scripts/readme-gen

noxfile.py

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -172,39 +172,6 @@ def docs(session):
172172
)
173173

174174

175-
@nox.session(python="3.7")
176-
def docfx(session):
177-
"""Build the docfx yaml files for this library."""
178-
179-
session.install("-e", ".")
180-
session.install("sphinx", "alabaster", "recommonmark")
181-
182-
shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True)
183-
session.run(
184-
"sphinx-build",
185-
"-T", # show full traceback on exception
186-
"-N", # no colors
187-
"-D",
188-
(
189-
"extensions=sphinx.ext.autodoc,"
190-
"sphinx.ext.autosummary,"
191-
"docfx_yaml.extension,"
192-
"sphinx.ext.intersphinx,"
193-
"sphinx.ext.coverage,"
194-
"sphinx.ext.napoleon,"
195-
"sphinx.ext.todo,"
196-
"sphinx.ext.viewcode,"
197-
"recommonmark"
198-
),
199-
"-b",
200-
"html",
201-
"-d",
202-
os.path.join("docs", "_build", "doctrees", ""),
203-
os.path.join("docs", ""),
204-
os.path.join("docs", "_build", "html", ""),
205-
)
206-
207-
208175
@nox.session(python=DEFAULT_PYTHON_VERSION)
209176
def docfx(session):
210177
"""Build the docfx yaml files for this library."""

samples/AUTHORING_GUIDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
See https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/AUTHORING_GUIDE.md

samples/CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
See https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/CONTRIBUTING.md

0 commit comments

Comments
 (0)