Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
9ea7ef6
Integrate Python GAPIC Microgenerator in googleapis. This PR uses usi…
yoshi-automation Oct 20, 2020
2aec090
chore(python): create thread_safety doc
yoshi-automation Oct 20, 2020
cf7c72f
chore(python): remove extra #!/bin/bash
yoshi-automation Oct 20, 2020
79d1eb4
fix: restore GAPIC v2 retry configs
yoshi-automation Oct 20, 2020
72d84b8
chore(python): remove one remaining extra bash line
yoshi-automation Oct 20, 2020
66e9e65
Upgrade protoc-docs-plugin version to 0.7.0 to fix unstable docstrings.
yoshi-automation Oct 20, 2020
75e3bd5
bazel: update protobuf, rules_go, gazelle, and gapic-generator-go ver…
yoshi-automation Oct 20, 2020
753984e
docs: update python docs template
yoshi-automation Oct 20, 2020
35abcfa
feat: add templates for python samples projects
yoshi-automation Oct 20, 2020
0b4302e
chore: update default ignores for Python libraries
yoshi-automation Oct 20, 2020
b578994
Regular update of Google API service config with clarification of doc…
yoshi-automation Oct 20, 2020
de33ccf
chore: set Ruby namespace in proto options
yoshi-automation Oct 20, 2020
a14d351
fix: use protoc-docs-plugin 0.8.0
yoshi-automation Oct 20, 2020
261e8af
fix(python): change autodoc_default_flags to autodoc_default_options
yoshi-automation Oct 20, 2020
b1913a4
chore: update grpc to v1.30.0
yoshi-automation Oct 20, 2020
dc0a411
Updates to build Google Ads API build files.
yoshi-automation Oct 20, 2020
5f7ddbe
chore: update Py2 support msg to reflect passage of time
yoshi-automation Oct 20, 2020
f9b8687
feat: Update Logging API protos.
yoshi-automation Oct 20, 2020
e0be185
Update protobuf and gapic-generator-csharp versions.
yoshi-automation Oct 20, 2020
c68b581
feat(python-library): changes to docs job
yoshi-automation Oct 20, 2020
048ba62
Revert "feat(python-library): changes to docs job (#700)"
yoshi-automation Oct 20, 2020
dc96dcc
feat(python-library): changes to docs job
yoshi-automation Oct 20, 2020
6504e5b
fix(python-library): add missing changes
yoshi-automation Oct 20, 2020
ea14f8a
chore(py_library): add split_system_tests
yoshi-automation Oct 20, 2020
2c7b42e
chore(py_library): add some excludes in docs/conf.py
yoshi-automation Oct 20, 2020
0a9625a
Update protobuf workspace dependency to v3.13.0.
yoshi-automation Oct 20, 2020
581cf7f
chore(py-library): enable snippet-bot
yoshi-automation Oct 20, 2020
1226d4f
chore(py-library): update decrypt secrets file
yoshi-automation Oct 20, 2020
2f306d4
chore(python-library): use sphinx 1.5.5 for the docfx job
yoshi-automation Oct 20, 2020
20e57c1
build(python): use release-publish app for notifying GitHub of releas…
yoshi-automation Oct 20, 2020
78d3b8b
build(python): add secret manager in kokoro
yoshi-automation Oct 20, 2020
8cafbfd
chore(python): add sphinx doctest extension
yoshi-automation Oct 20, 2020
5e25f49
feat: Add Java microgen rules to imports
yoshi-automation Oct 20, 2020
f5a76ee
Publish SLM logging proto for documentation
yoshi-automation Oct 20, 2020
153f08e
chore(python): skip reporting coverage for namespace package
yoshi-automation Oct 20, 2020
1e325d0
chore(python): use BUILD_SPECIFIC_GCLOUD_PROJECT for samples
yoshi-automation Oct 20, 2020
3a087b1
chore: use python microgenerator rules for logging
yoshi-automation Oct 20, 2020
93e24fd
build(python): samples tests should pass if no samples exist
yoshi-automation Oct 20, 2020
2804cbc
chore(python_library): change the docs bucket name
yoshi-automation Oct 20, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
# Generated by synthtool. DO NOT EDIT!
[run]
branch = True
omit =
google/cloud/__init__.py

[report]
fail_under = 100
Expand All @@ -32,4 +34,5 @@ omit =
*/gapic/*.py
*/proto/*.py
*/core/*.py
*/site-packages/*.py
*/site-packages/*.py
google/cloud/__init__.py
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ exclude =
# Exclude generated code.
**/proto/**
**/gapic/**
**/services/**
**/types/**
*_pb2.py

# Standard linting exemptions.
Expand Down
Empty file added .github/snippet-bot.yml
Empty file.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
dist
build
eggs
.eggs
parts
bin
var
Expand Down Expand Up @@ -45,14 +46,16 @@ pip-log.txt
# Built documentation
docs/_build
bigquery/docs/generated
docs.metadata

# Virtual environment
env/
coverage.xml
sponge_log.xml

# System test environment variables.
system_tests/local_test_setup

# Make sure a generated file isn't accidentally committed.
pylintrc
pylintrc.test
pylintrc.test
2 changes: 1 addition & 1 deletion .kokoro/docs/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ env_vars: {

env_vars: {
key: "V2_STAGING_BUCKET"
value: "docs-staging-v2-staging"
value: "docs-staging-v2"
}

# It will upload the docker image after successful builds.
Expand Down
43 changes: 43 additions & 0 deletions .kokoro/populate-secrets.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash
# 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.

set -eo pipefail

function now { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n' ;}
function msg { println "$*" >&2 ;}
function println { printf '%s\n' "$(now) $*" ;}


# Populates requested secrets set in SECRET_MANAGER_KEYS from service account:
# kokoro-trampoline@cloud-devrel-kokoro-resources.iam.gserviceaccount.com
SECRET_LOCATION="${KOKORO_GFILE_DIR}/secret_manager"
msg "Creating folder on disk for secrets: ${SECRET_LOCATION}"
mkdir -p ${SECRET_LOCATION}
for key in $(echo ${SECRET_MANAGER_KEYS} | sed "s/,/ /g")
do
msg "Retrieving secret ${key}"
docker run --entrypoint=gcloud \
--volume=${KOKORO_GFILE_DIR}:${KOKORO_GFILE_DIR} \
gcr.io/google.com/cloudsdktool/cloud-sdk \
secrets versions access latest \
--project cloud-devrel-kokoro-resources \
--secret ${key} > \
"${SECRET_LOCATION}/${key}"
if [[ $? == 0 ]]; then
msg "Secret written to ${SECRET_LOCATION}/${key}"
else
msg "Error retrieving secret ${key}"
fi
done
50 changes: 13 additions & 37 deletions .kokoro/release/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,42 +23,18 @@ env_vars: {
value: "github/python-logging/.kokoro/release.sh"
}

# Fetch the token needed for reporting release status to GitHub
before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73713
keyname: "yoshi-automation-github-key"
}
}
}

# Fetch PyPI password
before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73713
keyname: "google_cloud_pypi_password"
}
}
}

# Fetch magictoken to use with Magic Github Proxy
before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73713
keyname: "releasetool-magictoken"
}
}
# Fetch PyPI password
before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73713
keyname: "google_cloud_pypi_password"
}
}
}

# Fetch api key to use with Magic Github Proxy
before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73713
keyname: "magic-github-proxy-api-key"
}
}
}
# Tokens needed to report release status back to GitHub
env_vars: {
key: "SECRET_MANAGER_KEYS"
value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem"
}
6 changes: 6 additions & 0 deletions .kokoro/samples/python3.6/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ env_vars: {
value: "py-3.6"
}

# Declare build specific Cloud project.
env_vars: {
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
value: "python-docs-samples-tests-py36"
}

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/python-logging/.kokoro/test-samples.sh"
Expand Down
6 changes: 6 additions & 0 deletions .kokoro/samples/python3.7/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ env_vars: {
value: "py-3.7"
}

# Declare build specific Cloud project.
env_vars: {
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
value: "python-docs-samples-tests-py37"
}

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/python-logging/.kokoro/test-samples.sh"
Expand Down
6 changes: 6 additions & 0 deletions .kokoro/samples/python3.8/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ env_vars: {
value: "py-3.8"
}

# Declare build specific Cloud project.
env_vars: {
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
value: "python-docs-samples-tests-py38"
}

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/python-logging/.kokoro/test-samples.sh"
Expand Down
15 changes: 10 additions & 5 deletions .kokoro/trampoline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,14 @@

set -eo pipefail

python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" || ret_code=$?
# Always run the cleanup script, regardless of the success of bouncing into
# the container.
function cleanup() {
chmod +x ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh
${KOKORO_GFILE_DIR}/trampoline_cleanup.sh
echo "cleanup";
}
trap cleanup EXIT

chmod +x ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh
${KOKORO_GFILE_DIR}/trampoline_cleanup.sh || true

exit ${ret_code}
$(dirname $0)/populate-secrets.sh # Secret Manager secrets.
python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py"
19 changes: 0 additions & 19 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,25 +80,6 @@ We use `nox <https://nox.readthedocs.io/en/latest/>`__ to instrument our tests.

.. nox: https://pypi.org/project/nox/

Note on Editable Installs / Develop Mode
========================================

- As mentioned previously, using ``setuptools`` in `develop mode`_
or a ``pip`` `editable install`_ is not possible with this
library. This is because this library uses `namespace packages`_.
For context see `Issue #2316`_ and the relevant `PyPA issue`_.

Since ``editable`` / ``develop`` mode can't be used, packages
need to be installed directly. Hence your changes to the source
tree don't get incorporated into the **already installed**
package.

.. _namespace packages: https://www.python.org/dev/peps/pep-0420/
.. _Issue #2316: https://github.com/GoogleCloudPlatform/google-cloud-python/issues/2316
.. _PyPA issue: https://github.com/pypa/packaging-problems/issues/12
.. _develop mode: https://setuptools.readthedocs.io/en/latest/setuptools.html#development-mode
.. _editable install: https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs

*****************************************
I'm getting weird errors... Can you help?
*****************************************
Expand Down
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ recursive-include google *.json *.proto
recursive-include tests *
global-exclude *.py[co]
global-exclude __pycache__

# Exclude scripts for samples readmegen
prune scripts/readme-gen
4 changes: 2 additions & 2 deletions docs/_templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

<div class="body" role="main">
<div class="admonition" id="python2-eol">
On January 1, 2020 this library will no longer support Python 2 on the latest released version.
Previously released library versions will continue to be available. For more information please
As of January 1, 2020 this library no longer supports Python 2 on the latest released version.
Library versions released prior to that date will continue to be available. For more information please
visit <a href="https://cloud.google.com/python/docs/python2-sunset/">Python 2 support on Google Cloud</a>.
</div>
{% block body %} {% endblock %}
Expand Down
21 changes: 14 additions & 7 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath(".."))

# For plugins that can not read conf.py.
# See also: https://github.com/docascode/sphinx-docfx-yaml/issues/85
sys.path.insert(0, os.path.abspath("."))

__version__ = ""

# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
needs_sphinx = "1.6.3"
needs_sphinx = "1.5.5"

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
Expand All @@ -35,24 +39,22 @@
"sphinx.ext.autosummary",
"sphinx.ext.intersphinx",
"sphinx.ext.coverage",
"sphinx.ext.doctest",
"sphinx.ext.napoleon",
"sphinx.ext.todo",
"sphinx.ext.viewcode",
"recommonmark",
]

# autodoc/autosummary flags
autoclass_content = "both"
autodoc_default_flags = ["members"]
autodoc_default_options = {"members": True}
autosummary_generate = True


# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

# Allow markdown includes (so releases.md can include CHANGLEOG.md)
# http://www.sphinx-doc.org/en/master/markdown.html
source_parsers = {".md": "recommonmark.parser.CommonMarkParser"}

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
# source_suffix = ['.rst', '.md']
Expand Down Expand Up @@ -93,7 +95,12 @@

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ["_build"]
exclude_patterns = [
"_build",
"samples/AUTHORING_GUIDE.md",
"samples/CONTRIBUTING.md",
"samples/snippets/README.rst",
]

# The reST default role (used for this markup: `text`) to use for all
# documents.
Expand Down
7 changes: 7 additions & 0 deletions docs/multiprocessing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.. note::

Because this client uses :mod:`grpcio` library, it is safe to
share instances across threads. In multiprocessing scenarios, the best
practice is to create client instances *after* the invocation of
:func:`os.fork` by :class:`multiprocessing.Pool` or
:class:`multiprocessing.Process`.
Loading