Skip to content
Permalink
Browse files
fix: SSL error when using the client with the emulator (#297)
* fix: use insecure gRPC channel with the emulator

* Regenerate the library
  • Loading branch information
plamut committed Mar 2, 2021
1 parent 271a385 commit 83db67239d3521457138699109f766d574a0a2c4
Showing with 1,177 additions and 691 deletions.
  1. +7 −24 .coveragerc
  2. +15 −0 .github/header-checker-lint.yml
  3. +3 −1 .gitignore
  4. +20 −6 .kokoro/build.sh
  5. +11 −0 .kokoro/docs/docs-presubmit.cfg
  6. +1 −0 .trampolinerc
  7. +18 −4 CONTRIBUTING.rst
  8. +4 −3 LICENSE
  9. +2 −2 MANIFEST.in
  10. +6 −1 docs/_static/custom.css
  11. +30 −22 google/pubsub_v1/services/publisher/async_client.py
  12. +77 −46 google/pubsub_v1/services/publisher/client.py
  13. +34 −25 google/pubsub_v1/services/publisher/pagers.py
  14. +17 −6 google/pubsub_v1/services/publisher/transports/grpc.py
  15. +17 −6 google/pubsub_v1/services/publisher/transports/grpc_asyncio.py
  16. +25 −16 google/pubsub_v1/services/schema_service/async_client.py
  17. +56 −36 google/pubsub_v1/services/schema_service/client.py
  18. +18 −9 google/pubsub_v1/services/schema_service/pagers.py
  19. +17 −6 google/pubsub_v1/services/schema_service/transports/grpc.py
  20. +17 −6 google/pubsub_v1/services/schema_service/transports/grpc_asyncio.py
  21. +72 −53 google/pubsub_v1/services/subscriber/async_client.py
  22. +134 −93 google/pubsub_v1/services/subscriber/client.py
  23. +26 −17 google/pubsub_v1/services/subscriber/pagers.py
  24. +17 −6 google/pubsub_v1/services/subscriber/transports/grpc.py
  25. +17 −6 google/pubsub_v1/services/subscriber/transports/grpc_asyncio.py
  26. +35 −35 google/pubsub_v1/types/pubsub.py
  27. +8 −8 google/pubsub_v1/types/schema.py
  28. +27 −2 noxfile.py
  29. +1 −1 samples/snippets/noxfile.py
  30. +6 −6 synth.metadata
  31. +44 −0 synth.py
  32. +131 −82 tests/unit/gapic/pubsub_v1/test_publisher.py
  33. +133 −81 tests/unit/gapic/pubsub_v1/test_schema_service.py
  34. +131 −82 tests/unit/gapic/pubsub_v1/test_subscriber.py
@@ -1,35 +1,18 @@
# -*- 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
#
# https://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 synthtool. DO NOT EDIT!
[run]
branch = True

[report]
fail_under = 100
show_missing = True
omit =
google/pubsub/__init__.py
exclude_lines =
# Re-enable the standard pragma
pragma: NO COVER
# Ignore debug-only repr
def __repr__
# Ignore abstract methods
raise NotImplementedError
omit =
*/gapic/*.py
*/proto/*.py
*/core/*.py
*/site-packages/*.py
# Ignore pkg_resources exceptions.
# This is added at the module level as a safeguard for if someone
# generates the code and tries to run it without pip installing. This
# makes it virtually impossible to test properly.
except pkg_resources.DistributionNotFound
@@ -0,0 +1,15 @@
{"allowedCopyrightHolders": ["Google LLC"],
"allowedLicenses": ["Apache-2.0", "MIT", "BSD-3"],
"ignoreFiles": ["**/requirements.txt", "**/requirements-test.txt"],
"sourceFileExtensions": [
"ts",
"js",
"java",
"sh",
"Dockerfile",
"yaml",
"py",
"html",
"txt"
]
}
@@ -50,8 +50,10 @@ docs.metadata

# Virtual environment
env/

# Test logs
coverage.xml
sponge_log.xml
*sponge_log.xml

# System test environment variables.
system_tests/local_test_setup
@@ -15,7 +15,11 @@

set -eo pipefail

cd github/python-pubsub
if [[ -z "${PROJECT_ROOT:-}" ]]; then
PROJECT_ROOT="github/python-pubsub"
fi

cd "${PROJECT_ROOT}"

# Disable buffering, so that the logs stream through.
export PYTHONUNBUFFERED=1
@@ -30,16 +34,26 @@ export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json
export PROJECT_ID=$(cat "${KOKORO_GFILE_DIR}/project-id.json")

# Remove old nox
python3.6 -m pip uninstall --yes --quiet nox-automation
python3 -m pip uninstall --yes --quiet nox-automation

# Install nox
python3.6 -m pip install --upgrade --quiet nox
python3.6 -m nox --version
python3 -m pip install --upgrade --quiet nox
python3 -m nox --version

# If this is a continuous build, send the test log to the FlakyBot.
# See https://github.com/googleapis/repo-automation-bots/tree/master/packages/flakybot.
if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"continuous"* ]]; then
cleanup() {
chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot
$KOKORO_GFILE_DIR/linux_amd64/flakybot
}
trap cleanup EXIT HUP
fi

# If NOX_SESSION is set, it only runs the specified session,
# otherwise run all the sessions.
if [[ -n "${NOX_SESSION:-}" ]]; then
python3.6 -m nox -s "${NOX_SESSION:-}"
python3 -m nox -s ${NOX_SESSION:-}
else
python3.6 -m nox
python3 -m nox
fi
@@ -15,3 +15,14 @@ env_vars: {
key: "TRAMPOLINE_IMAGE_UPLOAD"
value: "false"
}

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/python-pubsub/.kokoro/build.sh"
}

# Only run this nox session.
env_vars: {
key: "NOX_SESSION"
value: "docs docfx"
}
@@ -24,6 +24,7 @@ required_envvars+=(
pass_down_envvars+=(
"STAGING_BUCKET"
"V2_STAGING_BUCKET"
"NOX_SESSION"
)

# Prevent unintentional override on the default image.
@@ -70,9 +70,14 @@ We use `nox <https://nox.readthedocs.io/en/latest/>`__ to instrument our tests.
- To test your changes, run unit tests with ``nox``::

$ nox -s unit-2.7
$ nox -s unit-3.7
$ nox -s unit-3.8
$ ...

- Args to pytest can be passed through the nox command separated by a `--`. For
example, to run a single test::

$ nox -s unit-3.8 -- -k <name of test>

.. note::

The unit tests and system tests are described in the
@@ -93,8 +98,12 @@ On Debian/Ubuntu::
************
Coding Style
************
- We use the automatic code formatter ``black``. You can run it using
the nox session ``blacken``. This will eliminate many lint errors. Run via::

$ nox -s blacken

- PEP8 compliance, with exceptions defined in the linter configuration.
- PEP8 compliance is required, with exceptions defined in the linter configuration.
If you have ``nox`` installed, you can test that you have not introduced
any non-compliant code via::

@@ -133,13 +142,18 @@ Running System Tests

- To run system tests, you can execute::

$ nox -s system-3.7
# Run all system tests
$ nox -s system-3.8
$ nox -s system-2.7

# Run a single system test
$ nox -s system-3.8 -- -k <name of test>


.. note::

System tests are only configured to run under Python 2.7 and
Python 3.7. For expediency, we do not run them in older versions
Python 3.8. For expediency, we do not run them in older versions
of Python 3.

This alone will not run the tests. You'll need to change some local
@@ -1,6 +1,7 @@
Apache License

Apache License
Version 2.0, January 2004
https://www.apache.org/licenses/
http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

@@ -192,7 +193,7 @@
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0
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,
@@ -16,10 +16,10 @@

# Generated by synthtool. DO NOT EDIT!
include README.rst LICENSE
recursive-include google *.json *.proto
recursive-include google *.json *.proto py.typed
recursive-include tests *
global-exclude *.py[co]
global-exclude __pycache__

# Exclude scripts for samples readmegen
prune scripts/readme-gen
prune scripts/readme-gen
@@ -1,4 +1,9 @@
div#python2-eol {
border-color: red;
border-width: medium;
}
}

/* Ensure minimum width for 'Parameters' / 'Returns' column */
dl.field-list > dt {
min-width: 100px
}
Loading

0 comments on commit 83db672

Please sign in to comment.