Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 63085f7

Browse files
Merge branch 'main' into apikey
2 parents d904728 + 4679219 commit 63085f7

27 files changed

+150
-72
lines changed

.github/.OwlBot.lock.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
docker:
22
image: gcr.io/repo-automation-bots/owlbot-python:latest
3-
digest: sha256:aea14a583128771ae8aefa364e1652f3c56070168ef31beb203534222d842b8b
3+
digest: sha256:1456ea2b3b523ccff5e13030acef56d1de28f21249c62aa0f196265880338fa7

.kokoro/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ python3 -m pip install --upgrade --quiet nox
4141
python3 -m nox --version
4242

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

.kokoro/test-samples-impl.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ for file in samples/**/requirements.txt; do
8080
EXIT=$?
8181

8282
# If this is a periodic build, send the test log to the FlakyBot.
83-
# See https://github.com/googleapis/repo-automation-bots/tree/master/packages/flakybot.
83+
# See https://github.com/googleapis/repo-automation-bots/tree/main/packages/flakybot.
8484
if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"periodic"* ]]; then
8585
chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot
8686
$KOKORO_GFILE_DIR/linux_amd64/flakybot

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,24 @@
44

55
[1]: https://pypi.org/project/google-api-core/#history
66

7+
### [2.0.1](https://www.github.com/googleapis/python-api-core/compare/v2.0.0...v2.0.1) (2021-08-31)
8+
9+
10+
### Bug Fixes
11+
12+
* do not error on LROs with no response or error ([#258](https://www.github.com/googleapis/python-api-core/issues/258)) ([618f192](https://www.github.com/googleapis/python-api-core/commit/618f19201af729205892fcecd9c8e315ba3174a3))
13+
14+
## [2.0.0](https://www.github.com/googleapis/python-api-core/compare/v2.0.0-b1...v2.0.0) (2021-08-18)
15+
16+
### ⚠ BREAKING CHANGES
17+
18+
* drop support for Python 2.7 / 3.5 ([#212](https://www.github.com/googleapis/python-api-core/issues/212)) ([a30f004](https://www.github.com/googleapis/python-api-core/commit/a30f004e74f709d46e905dd819c71f43354e9ac9))
19+
20+
### Bug Fixes
21+
22+
* bump grpcio version to use stable aio API ([#234](https://www.github.com/googleapis/python-api-core/issues/234)) ([bdbf889](https://www.github.com/googleapis/python-api-core/commit/bdbf889210b709d7c1945f2160bcba9161b4dd2e))
23+
* strip trailing _ from field mask paths ([#228](https://www.github.com/googleapis/python-api-core/issues/228)) ([ff6ef1b](https://www.github.com/googleapis/python-api-core/commit/ff6ef1bd07fa68307b7c82c910416d770e7b3416))
24+
725
## [2.0.0b1](https://www.github.com/googleapis/python-api-core/compare/v1.31.1...v2.0.0b1) (2021-08-03)
826

927

CONTRIBUTING.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ You'll have to create a development environment using a Git checkout:
4949
# Configure remotes such that you can pull changes from the googleapis/python-api-core
5050
# repository into your local repository.
5151
$ git remote add upstream [email protected]:googleapis/python-api-core.git
52-
# fetch and merge changes from upstream into master
52+
# fetch and merge changes from upstream into main
5353
$ git fetch upstream
54-
$ git merge upstream/master
54+
$ git merge upstream/main
5555

5656
Now your local repo is set up such that you will push changes to your GitHub
5757
repo, from which you can submit a pull request.
@@ -109,12 +109,12 @@ Coding Style
109109
variables::
110110

111111
export GOOGLE_CLOUD_TESTING_REMOTE="upstream"
112-
export GOOGLE_CLOUD_TESTING_BRANCH="master"
112+
export GOOGLE_CLOUD_TESTING_BRANCH="main"
113113

114114
By doing this, you are specifying the location of the most up-to-date
115115
version of ``python-api-core``. The the suggested remote name ``upstream``
116116
should point to the official ``googleapis`` checkout and the
117-
the branch should be the main branch on that remote (``master``).
117+
the branch should be the main branch on that remote (``main``).
118118

119119
- This repository contains configuration for the
120120
`pre-commit <https://pre-commit.com/>`__ tool, which automates checking
@@ -185,7 +185,7 @@ The `description on PyPI`_ for the project comes directly from the
185185
``README``. Due to the reStructuredText (``rst``) parser used by
186186
PyPI, relative links which will work on GitHub (e.g. ``CONTRIBUTING.rst``
187187
instead of
188-
``https://github.com/googleapis/python-api-core/blob/master/CONTRIBUTING.rst``)
188+
``https://github.com/googleapis/python-api-core/blob/main/CONTRIBUTING.rst``)
189189
may cause problems creating links or rendering the description.
190190

191191
.. _description on PyPI: https://pypi.org/project/google-api-core
@@ -210,7 +210,7 @@ We support:
210210

211211
Supported versions can be found in our ``noxfile.py`` `config`_.
212212

213-
.. _config: https://github.com/googleapis/python-api-core/blob/master/noxfile.py
213+
.. _config: https://github.com/googleapis/python-api-core/blob/main/noxfile.py
214214

215215

216216
We also explicitly decided to support Python 3 beginning with version 3.6.

docs/conf.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@
7676
# The encoding of source files.
7777
# source_encoding = 'utf-8-sig'
7878

79-
# The master toctree document.
80-
master_doc = "index"
79+
# The root toctree document.
80+
root_doc = "index"
8181

8282
# General information about the project.
8383
project = "google-api-core"
@@ -110,6 +110,7 @@
110110
# directories to ignore when looking for source files.
111111
exclude_patterns = [
112112
"_build",
113+
"**/.nox/**/*",
113114
"samples/AUTHORING_GUIDE.md",
114115
"samples/CONTRIBUTING.md",
115116
"samples/snippets/README.rst",
@@ -279,7 +280,7 @@
279280
# author, documentclass [howto, manual, or own class]).
280281
latex_documents = [
281282
(
282-
master_doc,
283+
root_doc,
283284
"google-api-core.tex",
284285
"google-api-core Documentation",
285286
author,
@@ -313,7 +314,7 @@
313314
# One entry per manual page. List of tuples
314315
# (source start file, name, description, authors, manual section).
315316
man_pages = [
316-
(master_doc, "google-api-core", "google-api-core Documentation", [author], 1,)
317+
(root_doc, "google-api-core", "google-api-core Documentation", [author], 1,)
317318
]
318319

319320
# If true, show URL addresses after external links.
@@ -327,7 +328,7 @@
327328
# dir menu entry, description, category)
328329
texinfo_documents = [
329330
(
330-
master_doc,
331+
root_doc,
331332
"google-api-core",
332333
"google-api-core Documentation",
333334
author,

google/api_core/exceptions.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,7 @@ class Cancelled(ClientError):
293293
"""Exception mapping a :attr:`grpc.StatusCode.CANCELLED` error."""
294294

295295
# This maps to HTTP status code 499. See
296-
# https://github.com/googleapis/googleapis/blob/master/google/rpc\
297-
# /code.proto
296+
# https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto
298297
code = 499
299298
grpc_status_code = grpc.StatusCode.CANCELLED if grpc is not None else None
300299

google/api_core/future/async_future.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ class AsyncFuture(base.Future):
4343
The :meth:`done` method should be implemented by subclasses. The polling
4444
behavior will repeatedly call ``done`` until it returns True.
4545
46-
.. note: Privacy here is intended to prevent the final class from
47-
overexposing, not to prevent subclasses from accessing methods.
46+
.. note::
47+
48+
Privacy here is intended to prevent the final class from
49+
overexposing, not to prevent subclasses from accessing methods.
4850
4951
Args:
5052
retry (google.api_core.retry.Retry): The retry configuration used

google/api_core/future/polling.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ class PollingFuture(base.Future):
4545
The :meth:`done` method should be implemented by subclasses. The polling
4646
behavior will repeatedly call ``done`` until it returns True.
4747
48-
.. note: Privacy here is intended to prevent the final class from
49-
overexposing, not to prevent subclasses from accessing methods.
48+
.. note::
49+
50+
Privacy here is intended to prevent the final class from
51+
overexposing, not to prevent subclasses from accessing methods.
5052
5153
Args:
5254
retry (google.api_core.retry.Retry): The retry configuration used

google/api_core/grpc_helpers_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import functools
2323

2424
import grpc
25-
from grpc.experimental import aio
25+
from grpc import aio
2626

2727
from google.api_core import exceptions, grpc_helpers
2828

google/api_core/operation.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,11 @@ def _set_result_from_operation(self):
140140
)
141141
self.set_exception(exception)
142142
else:
143-
exception = exceptions.GoogleAPICallError(
144-
"Unexpected state: Long-running operation had neither "
145-
"response nor error set."
146-
)
147-
self.set_exception(exception)
143+
# Some APIs set `done: true`, with an empty response.
144+
# Set the result to an empty message of the expected
145+
# result type.
146+
# https://google.aip.dev/151
147+
self.set_result(self._result_type())
148148

149149
def _refresh_and_update(self, retry=polling.DEFAULT_RETRY):
150150
"""Refresh the operation and update the result if needed.

google/api_core/operation_async.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,11 @@ def _set_result_from_operation(self):
136136
)
137137
self.set_exception(exception)
138138
else:
139-
exception = exceptions.GoogleAPICallError(
140-
"Unexpected state: Long-running operation had neither "
141-
"response nor error set."
142-
)
143-
self.set_exception(exception)
139+
# Some APIs set `done: true`, with an empty response.
140+
# Set the result to an empty message of the expected
141+
# result type.
142+
# https://google.aip.dev/151
143+
self.set_result(self._result_type())
144144

145145
async def _refresh_and_update(self, retry=async_future.DEFAULT_RETRY):
146146
"""Refresh the operation and update the result if needed.

google/api_core/retry.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,11 @@ def if_exception_type_predicate(exception):
113113
``INTERNAL(13)`` and its subclasses.
114114
- :class:`google.api_core.exceptions.TooManyRequests` - HTTP 429
115115
- :class:`google.api_core.exceptions.ServiceUnavailable` - HTTP 503
116-
- :class:`google.api_core.exceptions.ResourceExhausted` - gRPC
117-
``RESOURCE_EXHAUSTED(8)``
116+
- :class:`requests.exceptions.ConnectionError`
117+
- :class:`requests.exceptions.ChunkedEncodingError` - The server declared
118+
chunked encoding but sent an invalid chunk.
119+
- :class:`google.auth.exceptions.TransportError` - Used to indicate an
120+
error occurred during an HTTP request.
118121
"""
119122
# pylint: enable=invalid-name
120123

google/api_core/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
__version__ = "2.0.0b1"
15+
__version__ = "2.0.1"

noxfile.py

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,17 @@
2929
DEFAULT_PYTHON_VERSION = "3.7"
3030
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
3131

32-
_MINIMAL_ASYNCIO_SUPPORT_PYTHON_VERSION = [3, 6]
32+
# 'docfx' is excluded since it only needs to run in 'docs-presubmit'
33+
nox.options.sessions = [
34+
"unit",
35+
"unit_grpc_gcp",
36+
"cover",
37+
"pytype",
38+
"lint",
39+
"lint_setup_py",
40+
"blacken",
41+
"docs",
42+
]
3343

3444

3545
def _greater_or_equal_than_36(version_string):
@@ -80,8 +90,8 @@ def default(session):
8090
)
8191

8292
# Install all test dependencies, then install this package in-place.
83-
session.install("mock", "pytest", "pytest-cov", "grpcio >= 1.0.2")
84-
session.install("-e", ".", "-c", constraints_path)
93+
session.install("mock", "pytest", "pytest-cov")
94+
session.install("-e", ".[grpc]", "-c", constraints_path)
8595

8696
pytest_args = [
8797
"python",
@@ -124,7 +134,7 @@ def unit_grpc_gcp(session):
124134
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
125135
)
126136
# Install grpcio-gcp
127-
session.install("grpcio-gcp", "-c", constraints_path)
137+
session.install("-e", ".[grpcgcp]", "-c", constraints_path)
128138

129139
default(session)
130140

@@ -141,9 +151,7 @@ def lint_setup_py(session):
141151
@nox.session(python="3.6")
142152
def pytype(session):
143153
"""Run type-checking."""
144-
session.install(
145-
".", "grpcio >= 1.8.2", "grpcio-gcp >= 0.2.2", "pytype >= 2019.3.21"
146-
)
154+
session.install(".[grpc, grpcgcp]", "pytype >= 2019.3.21")
147155
session.run("pytype")
148156

149157

@@ -163,8 +171,7 @@ def cover(session):
163171
def docs(session):
164172
"""Build the docs for this library."""
165173

166-
session.install(".", "grpcio >= 1.8.2", "grpcio-gcp >= 0.2.2")
167-
session.install("-e", ".")
174+
session.install("-e", ".[grpc, grpcgcp]")
168175
session.install("sphinx==4.0.1", "alabaster", "recommonmark")
169176

170177
shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True)

owlbot.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,49 @@
4444
""",
4545
)
4646

47+
# Remove the replacements below once https://github.com/googleapis/synthtool/pull/1188 is merged
48+
49+
# Update googleapis/repo-automation-bots repo to main in .kokoro/*.sh files
50+
s.replace(
51+
".kokoro/*.sh", "repo-automation-bots/tree/master", "repo-automation-bots/tree/main"
52+
)
53+
54+
# Customize CONTRIBUTING.rst to replace master with main
55+
s.replace(
56+
"CONTRIBUTING.rst",
57+
"fetch and merge changes from upstream into master",
58+
"fetch and merge changes from upstream into main",
59+
)
60+
61+
s.replace(
62+
"CONTRIBUTING.rst", "git merge upstream/master", "git merge upstream/main",
63+
)
64+
65+
s.replace(
66+
"CONTRIBUTING.rst",
67+
"""export GOOGLE_CLOUD_TESTING_BRANCH=\"master\"""",
68+
"""export GOOGLE_CLOUD_TESTING_BRANCH=\"main\"""",
69+
)
70+
71+
s.replace(
72+
"CONTRIBUTING.rst", r"remote \(``master``\)", "remote (``main``)",
73+
)
74+
75+
s.replace(
76+
"CONTRIBUTING.rst", "blob/master/CONTRIBUTING.rst", "blob/main/CONTRIBUTING.rst",
77+
)
78+
79+
s.replace(
80+
"CONTRIBUTING.rst", "blob/master/noxfile.py", "blob/main/noxfile.py",
81+
)
82+
83+
s.replace(
84+
"docs/conf.py", "master_doc", "root_doc",
85+
)
86+
87+
s.replace(
88+
"docs/conf.py", "# The master toctree document.", "# The root toctree document.",
89+
)
90+
91+
4792
s.shell.run(["nox", "-s", "blacken"], hide_output=False)

renovate.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"extends": [
3-
"config:base", ":preserveSemverRanges"
3+
"config:base",
4+
"group:all",
5+
":preserveSemverRanges",
6+
":disableDependencyDashboard"
47
],
58
"ignorePaths": [".pre-commit-config.yaml"],
69
"pip_requirements": {

scripts/readme-gen/templates/install_deps.tmpl.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Install Dependencies
1212
.. _Python Development Environment Setup Guide:
1313
https://cloud.google.com/python/setup
1414

15-
#. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+.
15+
#. Create a virtualenv. Samples are compatible with Python 3.6+.
1616

1717
.. code-block:: bash
1818

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@
3434
"google-auth >= 1.25.0, < 3.0dev",
3535
"requests >= 2.18.0, < 3.0.0dev",
3636
"setuptools >= 40.3.0",
37-
'futures >= 3.2.0; python_version < "3.2"',
3837
]
3938
extras = {
40-
"grpc": "grpcio >= 1.29.0, < 2.0dev",
39+
"grpc": "grpcio >= 1.33.2, < 2.0dev",
4140
"grpcgcp": "grpcio-gcp >= 0.2.2",
4241
"grpcio-gcp": "grpcio-gcp >= 0.2.2",
4342
}

testing/constraints-3.6.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ google-auth==1.25.0
1111
requests==2.18.0
1212
setuptools==40.3.0
1313
packaging==14.3
14-
grpcio==1.29.0
14+
grpcio==1.33.2
1515
grpcio-gcp==0.2.2
1616
grpcio-gcp==0.2.2

tests/asyncio/gapic/test_method_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import datetime
1616

17-
from grpc.experimental import aio
17+
from grpc import aio
1818
import mock
1919
import pytest
2020

0 commit comments

Comments
 (0)