Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
345ed00
chore: remove support for Python 3.7 and 3.8
vchudnov-g Dec 4, 2025
e7d5849
chore: format
vchudnov-g Dec 4, 2025
00bacfc
fix `nox -s prerelease_deps` by adding dependencies to noxfile
vchudnov-g Dec 5, 2025
d91d4b1
chore: Use async mock in async test
vchudnov-g Dec 5, 2025
063991a
chore: Simplify code intended for Python 3.9+
vchudnov-g Dec 5, 2025
e6ab415
chore: remove unused import
vchudnov-g Dec 5, 2025
fa50b6a
chore:remove unused import; cosmetic
vchudnov-g Dec 5, 2025
02bdd5d
exclude coverage calculations on some exceptional lines
vchudnov-g Dec 5, 2025
e420f47
fix coverage: runder under proto 4.x
vchudnov-g Dec 5, 2025
6c2206c
test(proto-4.25.8): Fix to run on supported Python version (3.11)
vchudnov-g Dec 5, 2025
f9f4e7f
Have nox run the legacy protobuf test
vchudnov-g Dec 5, 2025
cf8c92a
fix coverage file names
vchudnov-g Dec 5, 2025
90cff72
don't worry about covering unit test
vchudnov-g Dec 5, 2025
39992e3
Cover legacy protobuf tests
vchudnov-g Dec 5, 2025
fb410f4
fix session skip in test
vchudnov-g Dec 5, 2025
371d27e
chore: require protobuf ≥ 4.25.8
vchudnov-g Dec 5, 2025
f9ce257
feat: warn users of upcoming minimum protobuf 5.0.0 requirement
vchudnov-g Dec 5, 2025
2a57035
chore: Pin depencies to lower bounds in constraints for lowest Python…
vchudnov-g Dec 8, 2025
0f9589e
chore: bumpgoogleapis-common-protos to vbersion supporting protobuf 4.x
vchudnov-g Dec 8, 2025
f4decd5
chjore: Update minimum version of google-auth to 2.35.0
vchudnov-g Dec 8, 2025
c506726
chore: require requests ≥ 2.20.0
vchudnov-g Dec 8, 2025
5ebe08d
chore: try removing NO COVER pragmas
vchudnov-g Dec 8, 2025
fe43df7
restore one NO COVER pragma
vchudnov-g Dec 8, 2025
b1b5822
clean up removed pragmas
vchudnov-g Dec 8, 2025
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
7 changes: 1 addition & 6 deletions .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,10 @@ jobs:
nox -s prerelease_deps
unit:
name: unit${{ matrix.option }}-${{ matrix.python }}
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2303): use `ubuntu-latest` once this bug is fixed.
# Use ubuntu-22.04 until Python 3.7 is removed from the test matrix
# https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
strategy:
matrix:
python:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
Expand Down
40 changes: 0 additions & 40 deletions .kokoro/samples/python3.7/common.cfg

This file was deleted.

6 changes: 0 additions & 6 deletions .kokoro/samples/python3.7/continuous.cfg

This file was deleted.

11 changes: 0 additions & 11 deletions .kokoro/samples/python3.7/periodic-head.cfg

This file was deleted.

6 changes: 0 additions & 6 deletions .kokoro/samples/python3.7/periodic.cfg

This file was deleted.

6 changes: 0 additions & 6 deletions .kokoro/samples/python3.7/presubmit.cfg

This file was deleted.

40 changes: 0 additions & 40 deletions .kokoro/samples/python3.8/common.cfg

This file was deleted.

6 changes: 0 additions & 6 deletions .kokoro/samples/python3.8/continuous.cfg

This file was deleted.

11 changes: 0 additions & 11 deletions .kokoro/samples/python3.8/periodic-head.cfg

This file was deleted.

6 changes: 0 additions & 6 deletions .kokoro/samples/python3.8/periodic.cfg

This file was deleted.

6 changes: 0 additions & 6 deletions .kokoro/samples/python3.8/presubmit.cfg

This file was deleted.

11 changes: 7 additions & 4 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# 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.9", "3.10", "3.11", "3.12", "3.13", "3.14"]

DEFAULT_PYTHON_VERSION = "3.14"
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
Expand Down Expand Up @@ -91,7 +91,9 @@ def install_prerelease_dependencies(session, constraints_path):
r"^\s*(\S+)(?===\S+)", constraints_text, flags=re.MULTILINE
)
]
session.install(*constraints_deps)
if constraints_deps:
session.install(*constraints_deps)

prerel_deps = [
"google-auth",
"googleapis-common-protos",
Expand All @@ -107,6 +109,9 @@ def install_prerelease_dependencies(session, constraints_path):
# Remaining dependencies
other_deps = [
"requests",
"pyasn1",
"cryptography",
"cachetools",
]
session.install(*other_deps)

Expand All @@ -124,7 +129,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-mock",
Expand Down Expand Up @@ -276,7 +280,6 @@ def mypy(session):
"types-requests",
"types-protobuf",
"types-dataclasses",
"types-mock; python_version=='3.7'",
)
session.run("mypy", "google", "tests")

Expand Down
14 changes: 5 additions & 9 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.9"
readme = "README.rst"
description = "Google API client core library"
classifiers = [
Expand All @@ -33,8 +33,7 @@ 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",
"Programming Language :: Python :: 3.11",
Expand Down Expand Up @@ -83,7 +82,7 @@ version = { attr = "google.api_core.version.__version__" }
include = ["google*"]

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

Expand All @@ -97,9 +96,7 @@ 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 @@ -110,6 +107,5 @@ 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",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should keep in a generic version of this warning, since we expect to start seeing it for other versions at some point in the future

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the warnings issued by _python_version_support.py are of type FutureWarning, which are captured by the rule above.

This particular configuration line was brought in from pytest.ini during the migration to TOML (#736) before we had the current Python version warnings


]
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.9
inputs =
google/
exclude =
Expand Down
16 changes: 0 additions & 16 deletions testing/constraints-3.7.txt

This file was deleted.

2 changes: 0 additions & 2 deletions testing/constraints-3.8.txt

This file was deleted.

17 changes: 0 additions & 17 deletions testing/constraints-async-rest-3.7.txt

This file was deleted.

2 changes: 1 addition & 1 deletion tests/asyncio/test_operation_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ async def test_unexpected_result(unused_sleep):
async def test_from_gapic():
operation_proto = make_operation_proto(done=True)
operations_client = mock.create_autospec(
operations_v1.OperationsClient, instance=True
operations_v1.OperationsAsyncClient, instance=True
)

future = operation_async.from_gapic(
Expand Down
Loading