Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: googleapis/python-recommendations-ai
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.2.2
Choose a base ref
...
head repository: googleapis/python-recommendations-ai
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.3.0
Choose a head ref
  • 8 commits
  • 29 files changed
  • 2 contributors

Commits on Jun 17, 2021

  1. chore: new owl bot post processor docker image (#54)

    Post-Processor: gcr.io/repo-automation-bots/owlbot-python:latest@sha256:58c7342b0bccf85028100adaa3d856cb4a871c22ca9c01960d996e66c40548ce
    gcf-owl-bot[bot] authored Jun 17, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    c13ded3 View commit details

Commits on Jun 19, 2021

  1. docs: omit mention of Python 2.7 in 'CONTRIBUTING.rst' (#1127) (#55)

    Closes #1126
    Source-Link: googleapis/synthtool@b91f129
    Post-Processor: gcr.io/repo-automation-bots/owlbot-python:latest@sha256:b6169fc6a5207b11800a7c002d0c5c2bc6d82697185ca12e666f44031468cfcd
    gcf-owl-bot[bot] authored Jun 19, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    47faef8 View commit details

Commits on Jun 20, 2021

  1. chore: update precommit hook pre-commit/pre-commit-hooks to v4 (#1083) (

    #57)
    
    [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)
    
    This PR contains the following updates:
    
    | Package | Type | Update | Change |
    |---|---|---|---|
    | [pre-commit/pre-commit-hooks](https://togithub.com/pre-commit/pre-commit-hooks) | repository | major | `v3.4.0` -> `v4.0.1` |
    
    ---
    
    ### Release Notes
    
    <details>
    <summary>pre-commit/pre-commit-hooks</summary>
    
    ### [`v4.0.1`](https://togithub.com/pre-commit/pre-commit-hooks/releases/v4.0.1)
    
    [Compare Source](https://togithub.com/pre-commit/pre-commit-hooks/compare/v4.0.0...v4.0.1)
    
    ##### Fixes
    
    -   `check-shebang-scripts-are-executable` fix entry point.
        -   [#&#8203;602](https://togithub.com/pre-commit/pre-commit-hooks/issues/602) issue by [@&#8203;Person-93](https://togithub.com/Person-93).
        -   [#&#8203;603](https://togithub.com/pre-commit/pre-commit-hooks/issues/603) PR by [@&#8203;scop](https://togithub.com/scop).
    
    ### [`v4.0.0`](https://togithub.com/pre-commit/pre-commit-hooks/releases/v4.0.0)
    
    [Compare Source](https://togithub.com/pre-commit/pre-commit-hooks/compare/v3.4.0...v4.0.0)
    
    ##### Features
    
    -   `check-json`: report duplicate keys.
        -   [#&#8203;558](https://togithub.com/pre-commit/pre-commit-hooks/issues/558) PR by [@&#8203;AdityaKhursale](https://togithub.com/AdityaKhursale).
        -   [#&#8203;554](https://togithub.com/pre-commit/pre-commit-hooks/issues/554) issue by [@&#8203;adamchainz](https://togithub.com/adamchainz).
    -   `no-commit-to-branch`: add `main` to default blocked branches.
        -   [#&#8203;565](https://togithub.com/pre-commit/pre-commit-hooks/issues/565) PR by [@&#8203;ndevenish](https://togithub.com/ndevenish).
    -   `check-case-conflict`: check conflicts in directory names as well.
        -   [#&#8203;575](https://togithub.com/pre-commit/pre-commit-hooks/issues/575) PR by [@&#8203;slsyy](https://togithub.com/slsyy).
        -   [#&#8203;70](https://togithub.com/pre-commit/pre-commit-hooks/issues/70) issue by [@&#8203;andyjack](https://togithub.com/andyjack).
    -   `check-vcs-permalinks`: forbid other branch names.
        -   [#&#8203;582](https://togithub.com/pre-commit/pre-commit-hooks/issues/582) PR by [@&#8203;jack1142](https://togithub.com/jack1142).
        -   [#&#8203;581](https://togithub.com/pre-commit/pre-commit-hooks/issues/581) issue by [@&#8203;jack1142](https://togithub.com/jack1142).
    -   `check-shebang-scripts-are-executable`: new hook which ensures shebang'd scripts are executable.
        -   [#&#8203;545](https://togithub.com/pre-commit/pre-commit-hooks/issues/545) PR by [@&#8203;scop](https://togithub.com/scop).
    
    ##### Fixes
    
    -   `check-executables-have-shebangs`: Short circuit shebang lookup on windows.
        -   [#&#8203;544](https://togithub.com/pre-commit/pre-commit-hooks/issues/544) PR by [@&#8203;scop](https://togithub.com/scop).
    -   `requirements-txt-fixer`: Fix comments which have indentation
        -   [#&#8203;549](https://togithub.com/pre-commit/pre-commit-hooks/issues/549) PR by [@&#8203;greshilov](https://togithub.com/greshilov).
        -   [#&#8203;548](https://togithub.com/pre-commit/pre-commit-hooks/issues/548) issue by [@&#8203;greshilov](https://togithub.com/greshilov).
    -   `pretty-format-json`: write to stdout using UTF-8 encoding.
        -   [#&#8203;571](https://togithub.com/pre-commit/pre-commit-hooks/issues/571) PR by [@&#8203;jack1142](https://togithub.com/jack1142).
        -   [#&#8203;570](https://togithub.com/pre-commit/pre-commit-hooks/issues/570) issue by [@&#8203;jack1142](https://togithub.com/jack1142).
    -   Use more inclusive language.
        -   [#&#8203;599](https://togithub.com/pre-commit/pre-commit-hooks/issues/599) PR by [@&#8203;asottile](https://togithub.com/asottile).
    
    ##### Breaking changes
    
    -   Remove deprecated hooks: `flake8`, `pyflakes`, `autopep8-wrapper`.
        -   [#&#8203;597](https://togithub.com/pre-commit/pre-commit-hooks/issues/597) PR by [@&#8203;asottile](https://togithub.com/asottile).
    
    </details>
    
    ---
    
    ### Configuration
    
    📅 **Schedule**: At any time (no schedule defined).
    
    🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.
    
    ♻️ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found.
    
    🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
    
    ---
    
     - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box.
    
    ---
    
    This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/synthtool).
    Source-Link: googleapis/synthtool@333fd90
    Post-Processor: gcr.io/repo-automation-bots/owlbot-python:latest@sha256:b8c131c558606d3cea6e18f8e87befbd448c1482319b0db3c5d5388fa6ea72e3
    gcf-owl-bot[bot] authored Jun 20, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5d5d73a View commit details

Commits on Jun 22, 2021

  1. chore: add kokoro 3.9 config templates (#1128) (#59)

    Source-Link: googleapis/synthtool@b0eb8a8
    Post-Processor: gcr.io/repo-automation-bots/owlbot-python:latest@sha256:df50e8d462f86d6bcb42f27ecad55bb12c404f1c65de9c6fe4c4d25120080bd6
    gcf-owl-bot[bot] authored Jun 22, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    2975fb0 View commit details

Commits on Jun 24, 2021

  1. feat: add always_use_jwt_access (#60)

    ... chore: update gapic-generator-ruby to the latest commit chore: release gapic-generator-typescript 1.5.0
    
    Committer: @miraleung
    PiperOrigin-RevId: 380641501
    
    Source-Link: googleapis/googleapis@076f7e9
    
    Source-Link: https://github.com/googleapis/googleapis-gen/commit/27e4c88b4048e5f56508d4e1aa417d60a3380892
    gcf-owl-bot[bot] authored Jun 24, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    354fc1c View commit details

Commits on Jun 26, 2021

  1. chore(python): simplify nox steps in CONTRIBUTING.rst (#62)

    Source-Link: googleapis/synthtool@26558ba
    Post-Processor: gcr.io/repo-automation-bots/owlbot-python:latest@sha256:99d90d097e4a4710cc8658ee0b5b963f4426d0e424819787c3ac1405c9a26719
    gcf-owl-bot[bot] authored Jun 26, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    fcfb88d View commit details

Commits on Jul 1, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3263c2e View commit details

Commits on Jul 12, 2021

  1. chore: release 0.3.0 (#61)

    🤖 I have created a release \*beep\* \*boop\*
    ---
    ## [0.3.0](https://www.github.com/googleapis/python-recommendations-ai/compare/v0.2.2...v0.3.0) (2021-07-01)
    
    
    ### Features
    
    * add always_use_jwt_access ([#60](https://www.github.com/googleapis/python-recommendations-ai/issues/60)) ([354fc1c](https://www.github.com/googleapis/python-recommendations-ai/commit/354fc1cef059a69ab2b1310858f546a66db6fe5a))
    
    
    ### Bug Fixes
    
    * disable always_use_jwt_access ([#64](https://www.github.com/googleapis/python-recommendations-ai/issues/64)) ([3263c2e](https://www.github.com/googleapis/python-recommendations-ai/commit/3263c2ee0eb44e283de7356dbf9410d8620a8727))
    
    
    ### Documentation
    
    * omit mention of Python 2.7 in 'CONTRIBUTING.rst' ([#1127](https://www.github.com/googleapis/python-recommendations-ai/issues/1127)) ([#55](https://www.github.com/googleapis/python-recommendations-ai/issues/55)) ([47faef8](https://www.github.com/googleapis/python-recommendations-ai/commit/47faef890d8356ce60da06925b92a50f23a34e20)), closes [#1126](https://www.github.com/googleapis/python-recommendations-ai/issues/1126)
    ---
    
    
    This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
    release-please[bot] authored Jul 12, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a5aa92c View commit details
Showing with 368 additions and 525 deletions.
  1. +0 −1 .coveragerc
  2. +1 −1 .github/.OwlBot.lock.yaml
  3. +40 −0 .kokoro/samples/python3.9/common.cfg
  4. +6 −0 .kokoro/samples/python3.9/continuous.cfg
  5. +11 −0 .kokoro/samples/python3.9/periodic-head.cfg
  6. +6 −0 .kokoro/samples/python3.9/periodic.cfg
  7. +6 −0 .kokoro/samples/python3.9/presubmit.cfg
  8. +1 −1 .pre-commit-config.yaml
  9. +17 −0 CHANGELOG.md
  10. +8 −13 CONTRIBUTING.rst
  11. +6 −6 docs/conf.py
  12. +15 −27 google/cloud/recommendationengine_v1beta1/services/catalog_service/transports/base.py
  13. +7 −3 google/cloud/recommendationengine_v1beta1/services/catalog_service/transports/grpc.py
  14. +7 −3 google/cloud/recommendationengine_v1beta1/services/catalog_service/transports/grpc_asyncio.py
  15. +15 −27 google/cloud/recommendationengine_v1beta1/services/prediction_api_key_registry/transports/base.py
  16. +7 −3 google/cloud/recommendationengine_v1beta1/services/prediction_api_key_registry/transports/grpc.py
  17. +7 −3 ...loud/recommendationengine_v1beta1/services/prediction_api_key_registry/transports/grpc_asyncio.py
  18. +15 −27 google/cloud/recommendationengine_v1beta1/services/prediction_service/transports/base.py
  19. +7 −3 google/cloud/recommendationengine_v1beta1/services/prediction_service/transports/grpc.py
  20. +7 −3 google/cloud/recommendationengine_v1beta1/services/prediction_service/transports/grpc_asyncio.py
  21. +15 −27 google/cloud/recommendationengine_v1beta1/services/user_event_service/transports/base.py
  22. +7 −3 google/cloud/recommendationengine_v1beta1/services/user_event_service/transports/grpc.py
  23. +7 −3 google/cloud/recommendationengine_v1beta1/services/user_event_service/transports/grpc_asyncio.py
  24. +2 −2 setup.py
  25. +1 −1 testing/constraints-3.6.txt
  26. +36 −92 tests/unit/gapic/recommendationengine_v1beta1/test_catalog_service.py
  27. +39 −92 tests/unit/gapic/recommendationengine_v1beta1/test_prediction_api_key_registry.py
  28. +36 −92 tests/unit/gapic/recommendationengine_v1beta1/test_prediction_service.py
  29. +36 −92 tests/unit/gapic/recommendationengine_v1beta1/test_user_event_service.py
1 change: 0 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@
branch = True

[report]
fail_under = 100
show_missing = True
omit =
google/cloud/recommendationengine/__init__.py
2 changes: 1 addition & 1 deletion .github/.OwlBot.lock.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
docker:
image: gcr.io/repo-automation-bots/owlbot-python:latest
digest: sha256:c66ba3c8d7bc8566f47df841f98cd0097b28fff0b1864c86f5817f4c8c3e8600
digest: sha256:99d90d097e4a4710cc8658ee0b5b963f4426d0e424819787c3ac1405c9a26719
40 changes: 40 additions & 0 deletions .kokoro/samples/python3.9/common.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Build logs will be here
action {
define_artifacts {
regex: "**/*sponge_log.xml"
}
}

# Specify which tests to run
env_vars: {
key: "RUN_TESTS_SESSION"
value: "py-3.9"
}

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

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/python-recommendations-ai/.kokoro/test-samples.sh"
}

# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker"
}

# Download secrets for samples
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples"

# Download trampoline resources.
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"

# Use the trampoline script to run in docker.
build_file: "python-recommendations-ai/.kokoro/trampoline.sh"
6 changes: 6 additions & 0 deletions .kokoro/samples/python3.9/continuous.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Format: //devtools/kokoro/config/proto/build.proto

env_vars: {
key: "INSTALL_LIBRARY_FROM_SOURCE"
value: "True"
}
11 changes: 11 additions & 0 deletions .kokoro/samples/python3.9/periodic-head.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Format: //devtools/kokoro/config/proto/build.proto

env_vars: {
key: "INSTALL_LIBRARY_FROM_SOURCE"
value: "True"
}

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/python-pubsub/.kokoro/test-samples-against-head.sh"
}
6 changes: 6 additions & 0 deletions .kokoro/samples/python3.9/periodic.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Format: //devtools/kokoro/config/proto/build.proto

env_vars: {
key: "INSTALL_LIBRARY_FROM_SOURCE"
value: "False"
}
6 changes: 6 additions & 0 deletions .kokoro/samples/python3.9/presubmit.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Format: //devtools/kokoro/config/proto/build.proto

env_vars: {
key: "INSTALL_LIBRARY_FROM_SOURCE"
value: "True"
}
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
rev: v4.0.1
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Changelog

## [0.3.0](https://www.github.com/googleapis/python-recommendations-ai/compare/v0.2.2...v0.3.0) (2021-07-01)


### Features

* add always_use_jwt_access ([#60](https://www.github.com/googleapis/python-recommendations-ai/issues/60)) ([354fc1c](https://www.github.com/googleapis/python-recommendations-ai/commit/354fc1cef059a69ab2b1310858f546a66db6fe5a))


### Bug Fixes

* disable always_use_jwt_access ([#64](https://www.github.com/googleapis/python-recommendations-ai/issues/64)) ([3263c2e](https://www.github.com/googleapis/python-recommendations-ai/commit/3263c2ee0eb44e283de7356dbf9410d8620a8727))


### Documentation

* omit mention of Python 2.7 in 'CONTRIBUTING.rst' ([#1127](https://www.github.com/googleapis/python-recommendations-ai/issues/1127)) ([#55](https://www.github.com/googleapis/python-recommendations-ai/issues/55)) ([47faef8](https://www.github.com/googleapis/python-recommendations-ai/commit/47faef890d8356ce60da06925b92a50f23a34e20)), closes [#1126](https://www.github.com/googleapis/python-recommendations-ai/issues/1126)

### [0.2.2](https://www.github.com/googleapis/python-recommendations-ai/compare/v0.2.1...v0.2.2) (2021-06-16)


21 changes: 8 additions & 13 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -68,15 +68,12 @@ Using ``nox``
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

$ nox -s unit-2.7
$ nox -s unit-3.8
$ ...
- To run a single unit test::

- Args to pytest can be passed through the nox command separated by a `--`. For
example, to run a single test::
$ nox -s unit-3.9 -- -k <name of test>

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

.. note::

@@ -143,18 +140,16 @@ Running System Tests
- To run system tests, you can execute::

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

# 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.8. For expediency, we do not run them in older versions
of Python 3.
System tests are only configured to run under 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
auth settings and change some configuration in your project to
@@ -218,8 +213,8 @@ Supported versions can be found in our ``noxfile.py`` `config`_.
.. _config: https://github.com/googleapis/python-recommendations-ai/blob/master/noxfile.py


We also explicitly decided to support Python 3 beginning with version
3.6. Reasons for this include:
We also explicitly decided to support Python 3 beginning with version 3.6.
Reasons for this include:

- Encouraging use of newest versions of Python 3
- Taking the lead of `prominent`_ open-source `projects`_
12 changes: 6 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -80,9 +80,9 @@
master_doc = "index"

# General information about the project.
project = u"google-cloud-recommendations-ai"
copyright = u"2019, Google"
author = u"Google APIs"
project = "google-cloud-recommendations-ai"
copyright = "2019, Google"
author = "Google APIs"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
@@ -281,7 +281,7 @@
(
master_doc,
"google-cloud-recommendations-ai.tex",
u"google-cloud-recommendations-ai Documentation",
"google-cloud-recommendations-ai Documentation",
author,
"manual",
)
@@ -316,7 +316,7 @@
(
master_doc,
"google-cloud-recommendations-ai",
u"google-cloud-recommendations-ai Documentation",
"google-cloud-recommendations-ai Documentation",
[author],
1,
)
@@ -335,7 +335,7 @@
(
master_doc,
"google-cloud-recommendations-ai",
u"google-cloud-recommendations-ai Documentation",
"google-cloud-recommendations-ai Documentation",
author,
"google-cloud-recommendations-ai",
"google-cloud-recommendations-ai Library",
Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@
from google.api_core import retry as retries # type: ignore
from google.api_core import operations_v1 # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore

from google.cloud.recommendationengine_v1beta1.types import catalog
from google.cloud.recommendationengine_v1beta1.types import catalog_service
@@ -50,8 +51,6 @@
except pkg_resources.DistributionNotFound: # pragma: NO COVER
_GOOGLE_AUTH_VERSION = None

_API_CORE_VERSION = google.api_core.__version__


class CatalogServiceTransport(abc.ABC):
"""Abstract transport class for CatalogService."""
@@ -69,6 +68,7 @@ def __init__(
scopes: Optional[Sequence[str]] = None,
quota_project_id: Optional[str] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
always_use_jwt_access: Optional[bool] = False,
**kwargs,
) -> None:
"""Instantiate the transport.
@@ -92,6 +92,8 @@ def __init__(
API requests. If ``None``, then default info will be used.
Generally, you only need to set this if you're developing
your own client library.
always_use_jwt_access (Optional[bool]): Whether self signed JWT should
be used for service account credentials.
"""
# Save the hostname. Default to port 443 (HTTPS) if none is specified.
if ":" not in host:
@@ -101,7 +103,7 @@ def __init__(
scopes_kwargs = self._get_scopes_kwargs(self._host, scopes)

# Save the scopes.
self._scopes = scopes or self.AUTH_SCOPES
self._scopes = scopes

# If no credentials are provided, then determine the appropriate
# defaults.
@@ -120,13 +122,20 @@ def __init__(
**scopes_kwargs, quota_project_id=quota_project_id
)

# If the credentials is service account credentials, then always try to use self signed JWT.
if (
always_use_jwt_access
and isinstance(credentials, service_account.Credentials)
and hasattr(service_account.Credentials, "with_always_use_jwt_access")
):
credentials = credentials.with_always_use_jwt_access(True)

# Save the credentials.
self._credentials = credentials

# TODO(busunkim): These two class methods are in the base transport
# TODO(busunkim): This method is in the base transport
# to avoid duplicating code across the transport classes. These functions
# should be deleted once the minimum required versions of google-api-core
# and google-auth are increased.
# should be deleted once the minimum required versions of google-auth is increased.

# TODO: Remove this function once google-auth >= 1.25.0 is required
@classmethod
@@ -147,27 +156,6 @@ def _get_scopes_kwargs(

return scopes_kwargs

# TODO: Remove this function once google-api-core >= 1.26.0 is required
@classmethod
def _get_self_signed_jwt_kwargs(
cls, host: str, scopes: Optional[Sequence[str]]
) -> Dict[str, Union[Optional[Sequence[str]], str]]:
"""Returns kwargs to pass to grpc_helpers.create_channel depending on the google-api-core version"""

self_signed_jwt_kwargs: Dict[str, Union[Optional[Sequence[str]], str]] = {}

if _API_CORE_VERSION and (
packaging.version.parse(_API_CORE_VERSION)
>= packaging.version.parse("1.26.0")
):
self_signed_jwt_kwargs["default_scopes"] = cls.AUTH_SCOPES
self_signed_jwt_kwargs["scopes"] = scopes
self_signed_jwt_kwargs["default_host"] = cls.DEFAULT_HOST
else:
self_signed_jwt_kwargs["scopes"] = scopes or cls.AUTH_SCOPES

return self_signed_jwt_kwargs

def _prep_wrapped_messages(self, client_info):
# Precompute the wrapped methods.
self._wrapped_methods = {
Original file line number Diff line number Diff line change
@@ -63,6 +63,7 @@ def __init__(
client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None,
quota_project_id: Optional[str] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
always_use_jwt_access: Optional[bool] = False,
) -> None:
"""Instantiate the transport.
@@ -103,6 +104,8 @@ def __init__(
API requests. If ``None``, then default info will be used.
Generally, you only need to set this if you're developing
your own client library.
always_use_jwt_access (Optional[bool]): Whether self signed JWT should
be used for service account credentials.
Raises:
google.auth.exceptions.MutualTLSChannelError: If mutual TLS transport
@@ -156,6 +159,7 @@ def __init__(
scopes=scopes,
quota_project_id=quota_project_id,
client_info=client_info,
always_use_jwt_access=always_use_jwt_access,
)

if not self._grpc_channel:
@@ -211,14 +215,14 @@ def create_channel(
and ``credentials_file`` are passed.
"""

self_signed_jwt_kwargs = cls._get_self_signed_jwt_kwargs(host, scopes)

return grpc_helpers.create_channel(
host,
credentials=credentials,
credentials_file=credentials_file,
quota_project_id=quota_project_id,
**self_signed_jwt_kwargs,
default_scopes=cls.AUTH_SCOPES,
scopes=scopes,
default_host=cls.DEFAULT_HOST,
**kwargs,
)

Original file line number Diff line number Diff line change
@@ -84,14 +84,14 @@ def create_channel(
aio.Channel: A gRPC AsyncIO channel object.
"""

self_signed_jwt_kwargs = cls._get_self_signed_jwt_kwargs(host, scopes)

return grpc_helpers_async.create_channel(
host,
credentials=credentials,
credentials_file=credentials_file,
quota_project_id=quota_project_id,
**self_signed_jwt_kwargs,
default_scopes=cls.AUTH_SCOPES,
scopes=scopes,
default_host=cls.DEFAULT_HOST,
**kwargs,
)

@@ -109,6 +109,7 @@ def __init__(
client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None,
quota_project_id=None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
always_use_jwt_access: Optional[bool] = False,
) -> None:
"""Instantiate the transport.
@@ -150,6 +151,8 @@ def __init__(
API requests. If ``None``, then default info will be used.
Generally, you only need to set this if you're developing
your own client library.
always_use_jwt_access (Optional[bool]): Whether self signed JWT should
be used for service account credentials.
Raises:
google.auth.exceptions.MutualTlsChannelError: If mutual TLS transport
@@ -202,6 +205,7 @@ def __init__(
scopes=scopes,
quota_project_id=quota_project_id,
client_info=client_info,
always_use_jwt_access=always_use_jwt_access,
)

if not self._grpc_channel:
Loading