Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 0 additions & 11 deletions .github/sync-repo-settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,6 @@ branchProtectionRules:
# No Kokoro: the following are Github actions
- 'lint'
- 'mypy'
- 'unit_grpc_gcp-3.7'
- 'unit_grpc_gcp-3.8'
- 'unit_grpc_gcp-3.9'
- 'unit_grpc_gcp-3.10'
- 'unit_grpc_gcp-3.11'
- 'unit_grpc_gcp-3.12'
- 'unit_grpc_gcp-3.13'
- 'unit_grpc_gcp-3.14'
- 'unit-3.7'
- 'unit-3.8'
- 'unit-3.9'
- 'unit-3.10'
Expand All @@ -32,15 +23,13 @@ branchProtectionRules:
- 'unit_wo_grpc-3.12'
- 'unit_wo_grpc-3.13'
- 'unit_wo_grpc-3.14'
- 'unit_w_prerelease_deps-3.7'
- 'unit_w_prerelease_deps-3.8'
- 'unit_w_prerelease_deps-3.9'
- 'unit_w_prerelease_deps-3.10'
- 'unit_w_prerelease_deps-3.11'
- 'unit_w_prerelease_deps-3.12'
- 'unit_w_prerelease_deps-3.13'
- 'unit_w_prerelease_deps-3.14'
- 'unit_w_async_rest_extra-3.7'
- 'unit_w_async_rest_extra-3.8'
- 'unit_w_async_rest_extra-3.9'
- 'unit_w_async_rest_extra-3.10'
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
option: ["", "_grpc_gcp", "_wo_grpc", "_w_prerelease_deps", "_w_async_rest_extra"]
option: ["", "_wo_grpc", "_w_prerelease_deps", "_w_async_rest_extra"]
python:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
Expand All @@ -25,8 +24,6 @@ jobs:
- "3.13"
- "3.14"
exclude:
- option: "_wo_grpc"
python: 3.7
- option: "_wo_grpc"
python: 3.8
- option: "_wo_grpc"
Expand Down
4 changes: 1 addition & 3 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ In order to add a feature:
documentation.

- The feature must work fully on the following CPython versions:
3.7, 3.8, 3.9, 3.10, 3.11, 3.12 and 3.13 on both UNIX and Windows.
3.8, 3.9, 3.10, 3.11, 3.12 and 3.13 on both UNIX and Windows.

- The feature must not add unnecessary dependencies (where
"unnecessary" is of course subjective, but new dependencies should
Expand Down Expand Up @@ -197,15 +197,13 @@ Supported Python Versions

We support:

- `Python 3.7`_
- `Python 3.8`_
- `Python 3.9`_
- `Python 3.10`_
- `Python 3.11`_
- `Python 3.12`_
- `Python 3.13`_

.. _Python 3.7: https://docs.python.org/3.7/
.. _Python 3.8: https://docs.python.org/3.8/
.. _Python 3.9: https://docs.python.org/3.9/
.. _Python 3.10: https://docs.python.org/3.10/
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ common helpers used by all Google API clients. For more information, see the

Supported Python Versions
-------------------------
Python >= 3.7
Python >= 3.8


Unsupported Python Versions
Expand Down
37 changes: 0 additions & 37 deletions google/api_core/grpc_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import collections
import functools
import warnings

import grpc

Expand All @@ -26,27 +25,6 @@
import google.auth.credentials
import google.auth.transport.grpc
import google.auth.transport.requests
import google.protobuf

PROTOBUF_VERSION = google.protobuf.__version__

# The grpcio-gcp package only has support for protobuf < 4
if PROTOBUF_VERSION[0:2] == "3.": # pragma: NO COVER
try:
import grpc_gcp

warnings.warn(
"""Support for grpcio-gcp is deprecated. This feature will be
removed from `google-api-core` after January 1, 2024. If you need to
continue to use this feature, please pin to a specific version of
`google-api-core`.""",
DeprecationWarning,
)
HAS_GRPC_GCP = True
except ImportError:
HAS_GRPC_GCP = False
else:
HAS_GRPC_GCP = False


# The list of gRPC Callable interfaces that return iterators.
Expand Down Expand Up @@ -389,21 +367,6 @@ def create_channel(
quota_project_id=quota_project_id,
default_host=default_host,
)

# Note that grpcio-gcp is deprecated
if HAS_GRPC_GCP: # pragma: NO COVER
if compression is not None and compression != grpc.Compression.NoCompression:
warnings.warn(
"The `compression` argument is ignored for grpc_gcp.secure_channel creation.",
DeprecationWarning,
)
if attempt_direct_path:
warnings.warn(
"""The `attempt_direct_path` argument is ignored for grpc_gcp.secure_channel creation.""",
DeprecationWarning,
)
return grpc_gcp.secure_channel(target, composite_credentials, **kwargs)

if attempt_direct_path:
target = _modify_target_for_direct_path(target)

Expand Down
4 changes: 2 additions & 2 deletions google/api_core/grpc_helpers_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

"""AsyncIO helpers for :mod:`grpc` supporting 3.7+.
"""AsyncIO helpers for :mod:`grpc` supporting 3.8+.

Please combine more detailed docstring in grpc_helpers.py to use following
functions. This module is implementing the same surface with AsyncIO semantics.
Expand Down Expand Up @@ -219,7 +219,7 @@ def create_channel(
default_host=None,
compression=None,
attempt_direct_path: Optional[bool] = False,
**kwargs
**kwargs,
):
"""Create an AsyncIO secure channel with credentials.

Expand Down
2 changes: 1 addition & 1 deletion google/api_core/operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def __init__(
result_type,
metadata_type=None,
polling=polling.DEFAULT_POLLING,
**kwargs
**kwargs,
):
super(Operation, self).__init__(polling=polling, **kwargs)
self._operation = operation
Expand Down
2 changes: 1 addition & 1 deletion google/api_core/operations_v1/pagers.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __init__(
request: operations_pb2.ListOperationsRequest,
response: operations_pb2.ListOperationsResponse,
*,
metadata: Sequence[Tuple[str, str]] = ()
metadata: Sequence[Tuple[str, str]] = (),
):
super().__init__(
method=method, request=request, response=response, metadata=metadata
Expand Down
2 changes: 1 addition & 1 deletion google/api_core/operations_v1/pagers_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __init__(
request: operations_pb2.ListOperationsRequest,
response: operations_pb2.ListOperationsResponse,
*,
metadata: Sequence[Tuple[str, str]] = ()
metadata: Sequence[Tuple[str, str]] = (),
):
super().__init__(
method=method, request=request, response=response, metadata=metadata
Expand Down
2 changes: 1 addition & 1 deletion google/api_core/operations_v1/pagers_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __init__(
request: operations_pb2.ListOperationsRequest,
response: operations_pb2.ListOperationsResponse,
*,
metadata: Sequence[Tuple[str, str]] = ()
metadata: Sequence[Tuple[str, str]] = (),
):
"""Instantiate the pager.

Expand Down
4 changes: 2 additions & 2 deletions google/api_core/operations_v1/transports/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ def _convert_protobuf_message_to_dict(
A dict representation of the protocol buffer message.
"""
# TODO(https://github.com/googleapis/python-api-core/issues/643): For backwards compatibility
# with protobuf 3.x 4.x, Remove once support for protobuf 3.x and 4.x is dropped.
if PROTOBUF_VERSION[0:2] in ["3.", "4."]:
# with protobuf 4.x, Remove once support for protobuf 4.x is dropped.
if PROTOBUF_VERSION[0:2] == "4.":
result = json_format.MessageToDict(
message,
preserving_proto_field_name=True,
Expand Down
24 changes: 1 addition & 23 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,14 @@
# Black and flake8 clash on the syntax for ignoring flake8's F401 in this file.
BLACK_EXCLUDES = ["--exclude", "^/google/api_core/operations_v1/__init__.py"]

PYTHON_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
PYTHON_VERSIONS = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]

DEFAULT_PYTHON_VERSION = "3.10"
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()

# 'docfx' is excluded since it only needs to run in 'docs-presubmit'
nox.options.sessions = [
"unit",
"unit_grpc_gcp",
"unit_wo_grpc",
"unit_w_prerelease_deps",
"unit_w_async_rest_extra",
Expand Down Expand Up @@ -124,7 +123,6 @@ def default(session, install_grpc=True, prerelease=False, install_async_rest=Fal

session.install(
"dataclasses",
"mock; python_version=='3.7'",
"pytest",
"pytest-cov",
"pytest-xdist",
Expand Down Expand Up @@ -225,25 +223,6 @@ def unit_w_prerelease_deps(session):
default(session, prerelease=True)


@nox.session(python=PYTHON_VERSIONS)
def unit_grpc_gcp(session):
"""
Run the unit test suite with grpcio-gcp installed.
`grpcio-gcp` doesn't support protobuf 4+.
Remove extra `grpcgcp` when protobuf 3.x is dropped.
https://github.com/googleapis/python-api-core/issues/594
"""
constraints_path = str(
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
)
# Install grpcio-gcp
session.install("-e", ".[grpcgcp]", "-c", constraints_path)
# Install protobuf < 4.0.0
session.install("protobuf<4.0.0")

default(session)


@nox.session(python=PYTHON_VERSIONS)
def unit_wo_grpc(session):
"""Run the unit test suite w/o grpcio installed"""
Expand Down Expand Up @@ -280,7 +259,6 @@ def mypy(session):
"types-requests",
"types-protobuf",
"types-dataclasses",
"types-mock; python_version=='3.7'",
)
session.run("mypy", "google", "tests")

Expand Down
16 changes: 4 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ build-backend = "setuptools.build_meta"
name = "google-api-core"
authors = [{ name = "Google LLC", email = "[email protected]" }]
license = { text = "Apache 2.0" }
requires-python = ">=3.7"
requires-python = ">=3.8"
readme = "README.rst"
description = "Google API client core library"
classifiers = [
Expand All @@ -33,7 +33,6 @@ classifiers = [
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Expand All @@ -44,8 +43,8 @@ classifiers = [
"Topic :: Internet",
]
dependencies = [
"googleapis-common-protos >= 1.56.2, < 2.0.0",
"protobuf >= 3.19.5, < 7.0.0, != 3.20.0, != 3.20.1, != 4.21.0, != 4.21.1, != 4.21.2, != 4.21.3, != 4.21.4, != 4.21.5",
"googleapis-common-protos >= 1.63.2, < 2.0.0",
"protobuf >= 4.25.8, < 7.0.0",
"proto-plus >= 1.22.3, < 2.0.0",
"proto-plus >= 1.25.0, < 2.0.0; python_version >= '3.13'",
"google-auth >= 2.14.1, < 3.0.0",
Expand All @@ -65,8 +64,6 @@ grpc = [
"grpcio-status >= 1.33.2, < 2.0.0",
"grpcio-status >= 1.49.1, < 2.0.0; python_version >= '3.11'",
]
grpcgcp = ["grpcio-gcp >= 0.2.2, < 1.0.0"]
grpcio-gcp = ["grpcio-gcp >= 0.2.2, < 1.0.0"]

[tool.setuptools.dynamic]
version = { attr = "google.api_core.version.__version__" }
Expand All @@ -77,7 +74,7 @@ version = { attr = "google.api_core.version.__version__" }
include = ["google*"]

[tool.mypy]
python_version = "3.7"
python_version = "3.8"
namespace_packages = true
ignore_missing_imports = true

Expand All @@ -89,9 +86,6 @@ filterwarnings = [
"ignore:.*The --rsyncdir command line argument and rsyncdirs config variable are deprecated:DeprecationWarning",
# Remove once https://github.com/protocolbuffers/protobuf/issues/12186 is fixed
"ignore:.*custom tp_new.*in Python 3.14:DeprecationWarning",
# Remove once support for python 3.7 is dropped
# This warning only appears when using python 3.7
"ignore:.*Using or importing the ABCs from.*collections:DeprecationWarning",
# Remove once support for grpcio-gcp is deprecated
# See https://github.com/googleapis/python-api-core/blob/42e8b6e6f426cab749b34906529e8aaf3f133d75/google/api_core/grpc_helpers.py#L39-L45
"ignore:.*Support for grpcio-gcp is deprecated:DeprecationWarning",
Expand All @@ -102,6 +96,4 @@ filterwarnings = [
"ignore:.*pkg_resources is deprecated as an API:DeprecationWarning",
# Remove once https://github.com/grpc/grpc/issues/35086 is fixed (and version newer than 1.60.0 is published)
"ignore:There is no current event loop:DeprecationWarning",
# Remove after support for Python 3.7 is dropped
"ignore:After January 1, 2024, new releases of this library will drop support for Python 3.7:DeprecationWarning",
]
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[pytype]
python_version = 3.7
python_version = 3.8
inputs =
google/
exclude =
Expand Down
15 changes: 0 additions & 15 deletions testing/constraints-3.7.txt

This file was deleted.

16 changes: 14 additions & 2 deletions testing/constraints-3.8.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
googleapis-common-protos==1.56.3
protobuf==4.21.6
# This constraints file is used to check that lower bounds
# are correct in setup.py
# List *all* library dependencies and extras in this file.
# Pin the version to the lower bound.
#
# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev",
# Then this file should have foo==1.14.0
googleapis-common-protos==1.63.2
protobuf==4.25.8
google-auth==2.14.1
requests==2.18.0
grpcio==1.33.2
grpcio-status==1.33.2
proto-plus==1.22.3
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
#
# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev",
# Then this file should have foo==1.14.0
googleapis-common-protos==1.56.2
protobuf==3.19.5
googleapis-common-protos==1.63.2
protobuf==4.25.8
google-auth==2.35.0
# from google-auth[aiohttp]
aiohttp==3.6.2
requests==2.20.0
grpcio==1.33.2
grpcio-status==1.33.2
grpcio-gcp==0.2.2
proto-plus==1.22.3
Loading