diff --git a/.librarian/generator-input/client-post-processing/datastore-integration.yaml b/.librarian/generator-input/client-post-processing/datastore-integration.yaml index aca5e5845036..7d81275e77c0 100644 --- a/.librarian/generator-input/client-post-processing/datastore-integration.yaml +++ b/.librarian/generator-input/client-post-processing/datastore-integration.yaml @@ -39,6 +39,42 @@ replacements: "google-cloud-core >= 2.0.0, <3.0.0", "grpcio >= 1.59.0, < 2.0.0", count: 1 + - paths: [ + "packages/google-cloud-datastore/mypy.ini", + ] + before: |- + # Performance: reuse results from previous runs to speed up 'nox' + incremental = True + after: |- + # Performance: reuse results from previous runs to speed up "nox" + incremental = True + + [mypy-google.cloud.datastore._app_engine_key_pb2] + ignore_errors = True + + # TODO(https://github.com/googleapis/gapic-generator-python/issues/2410): + # Remove once this generator bug is fixed + [mypy-google.cloud.datastore_v1.services.datastore.async_client] + ignore_errors = True + + # TODO(https://github.com/googleapis/gapic-generator-python/issues/2410): + # Remove once this generator bug is fixed + [mypy-google.cloud.datastore_v1.services.datastore.client] + ignore_errors = True + count: 1 + - paths: [ + "packages/google-cloud-datastore/mypy.ini", + ] + before: | + ignore_missing_imports = False + + # TODO\(https://github.com/googleapis/gapic-generator-python/issues/2563\): + # Dependencies that historically lacks py.typed markers + \[mypy-google\.iam\.\*\] + ignore_missing_imports = True + after: | + ignore_missing_imports = True + count: 1 - paths: [ "packages/google-cloud-datastore/docs/index.rst", ] diff --git a/mypy.ini b/mypy.ini deleted file mode 100644 index 9c9bb9d52935..000000000000 --- a/mypy.ini +++ /dev/null @@ -1,110 +0,0 @@ -[mypy] -namespace_packages = True -ignore_missing_imports = False - -# Helps mypy navigate the "google" namespace more reliably in 3.10+ -explicit_package_bases = True - -# Performance: reuse results from previous runs to speed up "nox" -incremental = True - -exclude = (?x)( - (^|/)third_party/ - | (^|/)tests/unit/resources/ - | (^|/)tests/unit/gapic/ - ) - - -# ============================================================================== -# GLOBAL THIRD-PARTY & SHARED LIBRARY IGNORES -# ============================================================================== - -[mypy-anywidget] -ignore_missing_imports = True - -[mypy-cloudpickle.*] -ignore_missing_imports = True - -[mypy-flask] -ignore_missing_imports = True - -[mypy-google.auth.*] -ignore_missing_imports = True - -[mypy-google.cloud.bigtable] -ignore_missing_imports = True - -[mypy-google.cloud.pubsub] -ignore_missing_imports = True - -[mypy-google.colab] -ignore_missing_imports = True - -[mypy-google.iam.*] -ignore_missing_imports = True - -[mypy-google.longrunning.*] -ignore_missing_imports = True - -[mypy-google.oauth2.*] -ignore_missing_imports = True - -[mypy-google.protobuf.*] -ignore_missing_imports = True - -[mypy-google.rpc.*] -ignore_missing_imports = True - -[mypy-google.type.*] -ignore_missing_imports = True - -[mypy-grpc.*] -ignore_missing_imports = True - -[mypy-ibis.*] -ignore_missing_imports = True - -[mypy-ipywidgets] -ignore_missing_imports = True - -[mypy-proto.*] -ignore_missing_imports = True - -[mypy-pyarrow.*] -ignore_missing_imports = True - -[mypy-pydata_google_auth] -ignore_missing_imports = True - -[mypy-pytest] -ignore_missing_imports = True - -[mypy-pytz] -ignore_missing_imports = True - - -# ============================================================================== -# PACKAGE-SPECIFIC OVERRIDES & EXCEPTIONS -# ============================================================================== - -# --- google-cloud-bigtable --- -[mypy-google.cloud.bigtable.*] -ignore_errors = True - -[mypy-google.cloud.bigtable.data.*] -check_untyped_defs = True -warn_unreachable = True -disallow_any_generics = True -ignore_errors = False - -# --- google-cloud-datastore --- -[mypy-google.cloud.datastore._app_engine_key_pb2] -ignore_errors = True - -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2410): -# Remove once this generator bug is fixed -[mypy-google.cloud.datastore_v1.services.datastore.async_client] -ignore_errors = True - -[mypy-google.cloud.datastore_v1.services.datastore.client] -ignore_errors = True diff --git a/packages/gapic-generator/gapic/ads-templates/mypy.ini.j2 b/packages/gapic-generator/gapic/ads-templates/mypy.ini.j2 new file mode 100644 index 000000000000..cb397f571128 --- /dev/null +++ b/packages/gapic-generator/gapic/ads-templates/mypy.ini.j2 @@ -0,0 +1,3 @@ +[mypy] +python_version = 3.10 +namespace_packages = True diff --git a/packages/gapic-generator/gapic/ads-templates/noxfile.py.j2 b/packages/gapic-generator/gapic/ads-templates/noxfile.py.j2 index 13b37159d38a..0a42cd6e4fa0 100644 --- a/packages/gapic-generator/gapic/ads-templates/noxfile.py.j2 +++ b/packages/gapic-generator/gapic/ads-templates/noxfile.py.j2 @@ -3,16 +3,10 @@ {% block content %} import os -import pathlib import nox # type: ignore -CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() -# Path to the centralized mypy configuration file at the repository root. -MYPY_CONFIG_FILE = str(CURRENT_DIRECTORY.parent.parent / "mypy.ini") - - # TODO(https://github.com/googleapis/gapic-generator-python/issues/2450): # Add tests for Python 3.15 alpha1 # https://peps.python.org/pep-0790/ @@ -50,7 +44,6 @@ def mypy(session): session.install('.') session.run( 'mypy', - f"--config-file={MYPY_CONFIG_FILE}", {% if api.naming.module_namespace %} '{{ api.naming.module_namespace[0] }}', {% else %} diff --git a/packages/gapic-generator/gapic/templates/mypy.ini.j2 b/packages/gapic-generator/gapic/templates/mypy.ini.j2 new file mode 100644 index 000000000000..defc5b1ed854 --- /dev/null +++ b/packages/gapic-generator/gapic/templates/mypy.ini.j2 @@ -0,0 +1,15 @@ +[mypy] +python_version = 3.14 +namespace_packages = True +ignore_missing_imports = False + +# TODO(https://github.com/googleapis/gapic-generator-python/issues/2563): +# Dependencies that historically lacks py.typed markers +[mypy-google.iam.*] +ignore_missing_imports = True + +# Helps mypy navigate the 'google' namespace more reliably in 3.10+ +explicit_package_bases = True + +# Performance: reuse results from previous runs to speed up 'nox' +incremental = True \ No newline at end of file diff --git a/packages/gapic-generator/gapic/templates/noxfile.py.j2 b/packages/gapic-generator/gapic/templates/noxfile.py.j2 index a11b38f658eb..c240871b994e 100644 --- a/packages/gapic-generator/gapic/templates/noxfile.py.j2 +++ b/packages/gapic-generator/gapic/templates/noxfile.py.j2 @@ -40,8 +40,6 @@ DEFAULT_PYTHON_VERSION = "3.14" PREVIEW_PYTHON_VERSION = "3.14" CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() -# Path to the centralized mypy configuration file at the repository root. -MYPY_CONFIG_FILE = str(CURRENT_DIRECTORY.parent.parent / "mypy.ini") if (CURRENT_DIRECTORY / "testing").exists(): LOWER_BOUND_CONSTRAINTS_FILE = ( @@ -103,7 +101,6 @@ def mypy(session): session.install(".") session.run( "mypy", - f"--config-file={MYPY_CONFIG_FILE}", "-p", {% if api.naming.module_namespace %} "{{ api.naming.module_namespace[0] }}", diff --git a/packages/gapic-generator/tests/integration/goldens/asset/mypy.ini b/packages/gapic-generator/tests/integration/goldens/asset/mypy.ini new file mode 100755 index 000000000000..e0e0da2e9e40 --- /dev/null +++ b/packages/gapic-generator/tests/integration/goldens/asset/mypy.ini @@ -0,0 +1,15 @@ +[mypy] +python_version = 3.14 +namespace_packages = True +ignore_missing_imports = False + +# TODO(https://github.com/googleapis/gapic-generator-python/issues/2563): +# Dependencies that historically lacks py.typed markers +[mypy-google.iam.*] +ignore_missing_imports = True + +# Helps mypy navigate the 'google' namespace more reliably in 3.10+ +explicit_package_bases = True + +# Performance: reuse results from previous runs to speed up 'nox' +incremental = True diff --git a/packages/gapic-generator/tests/integration/goldens/asset/noxfile.py b/packages/gapic-generator/tests/integration/goldens/asset/noxfile.py index bdbc94d16aad..93e185b59d11 100755 --- a/packages/gapic-generator/tests/integration/goldens/asset/noxfile.py +++ b/packages/gapic-generator/tests/integration/goldens/asset/noxfile.py @@ -47,8 +47,6 @@ PREVIEW_PYTHON_VERSION = "3.14" CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() -# Path to the centralized mypy configuration file at the repository root. -MYPY_CONFIG_FILE = str(CURRENT_DIRECTORY.parent.parent / "mypy.ini") if (CURRENT_DIRECTORY / "testing").exists(): LOWER_BOUND_CONSTRAINTS_FILE = ( @@ -110,7 +108,6 @@ def mypy(session): session.install(".") session.run( "mypy", - f"--config-file={MYPY_CONFIG_FILE}", "-p", "google", "--check-untyped-defs", diff --git a/packages/gapic-generator/tests/integration/goldens/credentials/mypy.ini b/packages/gapic-generator/tests/integration/goldens/credentials/mypy.ini new file mode 100755 index 000000000000..e0e0da2e9e40 --- /dev/null +++ b/packages/gapic-generator/tests/integration/goldens/credentials/mypy.ini @@ -0,0 +1,15 @@ +[mypy] +python_version = 3.14 +namespace_packages = True +ignore_missing_imports = False + +# TODO(https://github.com/googleapis/gapic-generator-python/issues/2563): +# Dependencies that historically lacks py.typed markers +[mypy-google.iam.*] +ignore_missing_imports = True + +# Helps mypy navigate the 'google' namespace more reliably in 3.10+ +explicit_package_bases = True + +# Performance: reuse results from previous runs to speed up 'nox' +incremental = True diff --git a/packages/gapic-generator/tests/integration/goldens/credentials/noxfile.py b/packages/gapic-generator/tests/integration/goldens/credentials/noxfile.py index dacd23460373..c991842b24ca 100755 --- a/packages/gapic-generator/tests/integration/goldens/credentials/noxfile.py +++ b/packages/gapic-generator/tests/integration/goldens/credentials/noxfile.py @@ -47,8 +47,6 @@ PREVIEW_PYTHON_VERSION = "3.14" CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() -# Path to the centralized mypy configuration file at the repository root. -MYPY_CONFIG_FILE = str(CURRENT_DIRECTORY.parent.parent / "mypy.ini") if (CURRENT_DIRECTORY / "testing").exists(): LOWER_BOUND_CONSTRAINTS_FILE = ( @@ -110,7 +108,6 @@ def mypy(session): session.install(".") session.run( "mypy", - f"--config-file={MYPY_CONFIG_FILE}", "-p", "google", "--check-untyped-defs", diff --git a/packages/gapic-generator/tests/integration/goldens/eventarc/mypy.ini b/packages/gapic-generator/tests/integration/goldens/eventarc/mypy.ini new file mode 100755 index 000000000000..e0e0da2e9e40 --- /dev/null +++ b/packages/gapic-generator/tests/integration/goldens/eventarc/mypy.ini @@ -0,0 +1,15 @@ +[mypy] +python_version = 3.14 +namespace_packages = True +ignore_missing_imports = False + +# TODO(https://github.com/googleapis/gapic-generator-python/issues/2563): +# Dependencies that historically lacks py.typed markers +[mypy-google.iam.*] +ignore_missing_imports = True + +# Helps mypy navigate the 'google' namespace more reliably in 3.10+ +explicit_package_bases = True + +# Performance: reuse results from previous runs to speed up 'nox' +incremental = True diff --git a/packages/gapic-generator/tests/integration/goldens/eventarc/noxfile.py b/packages/gapic-generator/tests/integration/goldens/eventarc/noxfile.py index d950dd9d285b..1ec5368a9dd4 100755 --- a/packages/gapic-generator/tests/integration/goldens/eventarc/noxfile.py +++ b/packages/gapic-generator/tests/integration/goldens/eventarc/noxfile.py @@ -47,8 +47,6 @@ PREVIEW_PYTHON_VERSION = "3.14" CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() -# Path to the centralized mypy configuration file at the repository root. -MYPY_CONFIG_FILE = str(CURRENT_DIRECTORY.parent.parent / "mypy.ini") if (CURRENT_DIRECTORY / "testing").exists(): LOWER_BOUND_CONSTRAINTS_FILE = ( @@ -110,7 +108,6 @@ def mypy(session): session.install(".") session.run( "mypy", - f"--config-file={MYPY_CONFIG_FILE}", "-p", "google", "--check-untyped-defs", diff --git a/packages/gapic-generator/tests/integration/goldens/logging/mypy.ini b/packages/gapic-generator/tests/integration/goldens/logging/mypy.ini new file mode 100755 index 000000000000..e0e0da2e9e40 --- /dev/null +++ b/packages/gapic-generator/tests/integration/goldens/logging/mypy.ini @@ -0,0 +1,15 @@ +[mypy] +python_version = 3.14 +namespace_packages = True +ignore_missing_imports = False + +# TODO(https://github.com/googleapis/gapic-generator-python/issues/2563): +# Dependencies that historically lacks py.typed markers +[mypy-google.iam.*] +ignore_missing_imports = True + +# Helps mypy navigate the 'google' namespace more reliably in 3.10+ +explicit_package_bases = True + +# Performance: reuse results from previous runs to speed up 'nox' +incremental = True diff --git a/packages/gapic-generator/tests/integration/goldens/logging/noxfile.py b/packages/gapic-generator/tests/integration/goldens/logging/noxfile.py index 7296b5795a8b..448aec3ef2b0 100755 --- a/packages/gapic-generator/tests/integration/goldens/logging/noxfile.py +++ b/packages/gapic-generator/tests/integration/goldens/logging/noxfile.py @@ -47,8 +47,6 @@ PREVIEW_PYTHON_VERSION = "3.14" CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() -# Path to the centralized mypy configuration file at the repository root. -MYPY_CONFIG_FILE = str(CURRENT_DIRECTORY.parent.parent / "mypy.ini") if (CURRENT_DIRECTORY / "testing").exists(): LOWER_BOUND_CONSTRAINTS_FILE = ( @@ -110,7 +108,6 @@ def mypy(session): session.install(".") session.run( "mypy", - f"--config-file={MYPY_CONFIG_FILE}", "-p", "google", "--check-untyped-defs", diff --git a/packages/gapic-generator/tests/integration/goldens/logging_internal/mypy.ini b/packages/gapic-generator/tests/integration/goldens/logging_internal/mypy.ini new file mode 100755 index 000000000000..e0e0da2e9e40 --- /dev/null +++ b/packages/gapic-generator/tests/integration/goldens/logging_internal/mypy.ini @@ -0,0 +1,15 @@ +[mypy] +python_version = 3.14 +namespace_packages = True +ignore_missing_imports = False + +# TODO(https://github.com/googleapis/gapic-generator-python/issues/2563): +# Dependencies that historically lacks py.typed markers +[mypy-google.iam.*] +ignore_missing_imports = True + +# Helps mypy navigate the 'google' namespace more reliably in 3.10+ +explicit_package_bases = True + +# Performance: reuse results from previous runs to speed up 'nox' +incremental = True diff --git a/packages/gapic-generator/tests/integration/goldens/logging_internal/noxfile.py b/packages/gapic-generator/tests/integration/goldens/logging_internal/noxfile.py index 7296b5795a8b..448aec3ef2b0 100755 --- a/packages/gapic-generator/tests/integration/goldens/logging_internal/noxfile.py +++ b/packages/gapic-generator/tests/integration/goldens/logging_internal/noxfile.py @@ -47,8 +47,6 @@ PREVIEW_PYTHON_VERSION = "3.14" CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() -# Path to the centralized mypy configuration file at the repository root. -MYPY_CONFIG_FILE = str(CURRENT_DIRECTORY.parent.parent / "mypy.ini") if (CURRENT_DIRECTORY / "testing").exists(): LOWER_BOUND_CONSTRAINTS_FILE = ( @@ -110,7 +108,6 @@ def mypy(session): session.install(".") session.run( "mypy", - f"--config-file={MYPY_CONFIG_FILE}", "-p", "google", "--check-untyped-defs", diff --git a/packages/gapic-generator/tests/integration/goldens/redis/mypy.ini b/packages/gapic-generator/tests/integration/goldens/redis/mypy.ini new file mode 100755 index 000000000000..e0e0da2e9e40 --- /dev/null +++ b/packages/gapic-generator/tests/integration/goldens/redis/mypy.ini @@ -0,0 +1,15 @@ +[mypy] +python_version = 3.14 +namespace_packages = True +ignore_missing_imports = False + +# TODO(https://github.com/googleapis/gapic-generator-python/issues/2563): +# Dependencies that historically lacks py.typed markers +[mypy-google.iam.*] +ignore_missing_imports = True + +# Helps mypy navigate the 'google' namespace more reliably in 3.10+ +explicit_package_bases = True + +# Performance: reuse results from previous runs to speed up 'nox' +incremental = True diff --git a/packages/gapic-generator/tests/integration/goldens/redis/noxfile.py b/packages/gapic-generator/tests/integration/goldens/redis/noxfile.py index ca0b6b791d68..d860093c9653 100755 --- a/packages/gapic-generator/tests/integration/goldens/redis/noxfile.py +++ b/packages/gapic-generator/tests/integration/goldens/redis/noxfile.py @@ -47,8 +47,6 @@ PREVIEW_PYTHON_VERSION = "3.14" CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() -# Path to the centralized mypy configuration file at the repository root. -MYPY_CONFIG_FILE = str(CURRENT_DIRECTORY.parent.parent / "mypy.ini") if (CURRENT_DIRECTORY / "testing").exists(): LOWER_BOUND_CONSTRAINTS_FILE = ( @@ -110,7 +108,6 @@ def mypy(session): session.install(".") session.run( "mypy", - f"--config-file={MYPY_CONFIG_FILE}", "-p", "google", "--check-untyped-defs", diff --git a/packages/gapic-generator/tests/integration/goldens/redis_selective/mypy.ini b/packages/gapic-generator/tests/integration/goldens/redis_selective/mypy.ini new file mode 100755 index 000000000000..e0e0da2e9e40 --- /dev/null +++ b/packages/gapic-generator/tests/integration/goldens/redis_selective/mypy.ini @@ -0,0 +1,15 @@ +[mypy] +python_version = 3.14 +namespace_packages = True +ignore_missing_imports = False + +# TODO(https://github.com/googleapis/gapic-generator-python/issues/2563): +# Dependencies that historically lacks py.typed markers +[mypy-google.iam.*] +ignore_missing_imports = True + +# Helps mypy navigate the 'google' namespace more reliably in 3.10+ +explicit_package_bases = True + +# Performance: reuse results from previous runs to speed up 'nox' +incremental = True diff --git a/packages/gapic-generator/tests/integration/goldens/redis_selective/noxfile.py b/packages/gapic-generator/tests/integration/goldens/redis_selective/noxfile.py index ca0b6b791d68..d860093c9653 100755 --- a/packages/gapic-generator/tests/integration/goldens/redis_selective/noxfile.py +++ b/packages/gapic-generator/tests/integration/goldens/redis_selective/noxfile.py @@ -47,8 +47,6 @@ PREVIEW_PYTHON_VERSION = "3.14" CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() -# Path to the centralized mypy configuration file at the repository root. -MYPY_CONFIG_FILE = str(CURRENT_DIRECTORY.parent.parent / "mypy.ini") if (CURRENT_DIRECTORY / "testing").exists(): LOWER_BOUND_CONSTRAINTS_FILE = ( @@ -110,7 +108,6 @@ def mypy(session): session.install(".") session.run( "mypy", - f"--config-file={MYPY_CONFIG_FILE}", "-p", "google", "--check-untyped-defs", diff --git a/packages/gapic-generator/tests/integration/goldens/storagebatchoperations/mypy.ini b/packages/gapic-generator/tests/integration/goldens/storagebatchoperations/mypy.ini new file mode 100755 index 000000000000..e0e0da2e9e40 --- /dev/null +++ b/packages/gapic-generator/tests/integration/goldens/storagebatchoperations/mypy.ini @@ -0,0 +1,15 @@ +[mypy] +python_version = 3.14 +namespace_packages = True +ignore_missing_imports = False + +# TODO(https://github.com/googleapis/gapic-generator-python/issues/2563): +# Dependencies that historically lacks py.typed markers +[mypy-google.iam.*] +ignore_missing_imports = True + +# Helps mypy navigate the 'google' namespace more reliably in 3.10+ +explicit_package_bases = True + +# Performance: reuse results from previous runs to speed up 'nox' +incremental = True diff --git a/packages/gapic-generator/tests/integration/goldens/storagebatchoperations/noxfile.py b/packages/gapic-generator/tests/integration/goldens/storagebatchoperations/noxfile.py index 141088cbacc3..9afec5aeae68 100755 --- a/packages/gapic-generator/tests/integration/goldens/storagebatchoperations/noxfile.py +++ b/packages/gapic-generator/tests/integration/goldens/storagebatchoperations/noxfile.py @@ -47,8 +47,6 @@ PREVIEW_PYTHON_VERSION = "3.14" CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() -# Path to the centralized mypy configuration file at the repository root. -MYPY_CONFIG_FILE = str(CURRENT_DIRECTORY.parent.parent / "mypy.ini") if (CURRENT_DIRECTORY / "testing").exists(): LOWER_BOUND_CONSTRAINTS_FILE = ( @@ -110,7 +108,6 @@ def mypy(session): session.install(".") session.run( "mypy", - f"--config-file={MYPY_CONFIG_FILE}", "-p", "google", "--check-untyped-defs", diff --git a/packages/google-cloud-datastore/google/cloud/datastore_admin_v1/__init__.py b/packages/google-cloud-datastore/google/cloud/datastore_admin_v1/__init__.py index e6209583615b..ab92fd717567 100644 --- a/packages/google-cloud-datastore/google/cloud/datastore_admin_v1/__init__.py +++ b/packages/google-cloud-datastore/google/cloud/datastore_admin_v1/__init__.py @@ -75,7 +75,7 @@ def parse_version_to_tuple(version_string: str): """Safely converts a semantic version string to a comparable tuple of integers. - Example: "6.33.5" -> (6, 33, 5) + Example: "4.25.8" -> (4, 25, 8) Ignores non-numeric parts and handles common version formats. Args: version_string: Version string in the format "x.y.z" or "x.y.z" @@ -104,9 +104,9 @@ def _get_version(dependency_name): return (None, "--") _dependency_package = "google.protobuf" - _next_supported_version = "6.33.5" - _next_supported_version_tuple = (6, 33, 5) - _recommendation = " (we recommend 7.x)" + _next_supported_version = "4.25.8" + _next_supported_version_tuple = (4, 25, 8) + _recommendation = " (we recommend 6.x)" (_version_used, _version_used_string) = _get_version(_dependency_package) if _version_used and _version_used < _next_supported_version_tuple: warnings.warn( diff --git a/packages/google-cloud-datastore/google/cloud/datastore_v1/__init__.py b/packages/google-cloud-datastore/google/cloud/datastore_v1/__init__.py index 7017a18c095c..7e8f2602291d 100644 --- a/packages/google-cloud-datastore/google/cloud/datastore_v1/__init__.py +++ b/packages/google-cloud-datastore/google/cloud/datastore_v1/__init__.py @@ -98,7 +98,7 @@ def parse_version_to_tuple(version_string: str): """Safely converts a semantic version string to a comparable tuple of integers. - Example: "6.33.5" -> (6, 33, 5) + Example: "4.25.8" -> (4, 25, 8) Ignores non-numeric parts and handles common version formats. Args: version_string: Version string in the format "x.y.z" or "x.y.z" @@ -127,9 +127,9 @@ def _get_version(dependency_name): return (None, "--") _dependency_package = "google.protobuf" - _next_supported_version = "6.33.5" - _next_supported_version_tuple = (6, 33, 5) - _recommendation = " (we recommend 7.x)" + _next_supported_version = "4.25.8" + _next_supported_version_tuple = (4, 25, 8) + _recommendation = " (we recommend 6.x)" (_version_used, _version_used_string) = _get_version(_dependency_package) if _version_used and _version_used < _next_supported_version_tuple: warnings.warn( diff --git a/packages/google-cloud-datastore/mypy.ini b/packages/google-cloud-datastore/mypy.ini new file mode 100644 index 000000000000..2d553926db9d --- /dev/null +++ b/packages/google-cloud-datastore/mypy.ini @@ -0,0 +1,23 @@ +[mypy] +python_version = 3.14 +namespace_packages = True +ignore_missing_imports = True + +# Helps mypy navigate the 'google' namespace more reliably in 3.10+ +explicit_package_bases = True + +# Performance: reuse results from previous runs to speed up "nox" +incremental = True + +[mypy-google.cloud.datastore._app_engine_key_pb2] +ignore_errors = True + +# TODO(https://github.com/googleapis/gapic-generator-python/issues/2410): +# Remove once this generator bug is fixed +[mypy-google.cloud.datastore_v1.services.datastore.async_client] +ignore_errors = True + +# TODO(https://github.com/googleapis/gapic-generator-python/issues/2410): +# Remove once this generator bug is fixed +[mypy-google.cloud.datastore_v1.services.datastore.client] +ignore_errors = True diff --git a/packages/google-cloud-datastore/noxfile.py b/packages/google-cloud-datastore/noxfile.py index 9e9c06b33b12..af42d740478e 100644 --- a/packages/google-cloud-datastore/noxfile.py +++ b/packages/google-cloud-datastore/noxfile.py @@ -46,8 +46,6 @@ PREVIEW_PYTHON_VERSION = "3.14" CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() -# Path to the centralized mypy configuration file at the repository root. -MYPY_CONFIG_FILE = str(CURRENT_DIRECTORY.parent.parent / "mypy.ini") if (CURRENT_DIRECTORY / "testing").exists(): LOWER_BOUND_CONSTRAINTS_FILE = ( @@ -109,7 +107,6 @@ def mypy(session): session.install(".") session.run( "mypy", - f"--config-file={MYPY_CONFIG_FILE}", "-p", "google", # TODO(https://github.com/googleapis/google-cloud-python/issues/16083) diff --git a/packages/google-cloud-datastore/setup.py b/packages/google-cloud-datastore/setup.py index 26f21974303e..b0cac8c0ec50 100644 --- a/packages/google-cloud-datastore/setup.py +++ b/packages/google-cloud-datastore/setup.py @@ -29,10 +29,7 @@ version = None with open(os.path.join(package_root, "google/cloud/datastore/gapic_version.py")) as fp: - version_candidates = re.findall( - r"(?<=\")\d+\.\d+\.\d+[^\"\s]*(?=\")", - fp.read(), - ) + version_candidates = re.findall(r"(?<=\")\d+.\d+.\d+(?=\")", fp.read()) assert len(version_candidates) == 1 version = version_candidates[0] @@ -42,15 +39,16 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.24.2, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", "google-cloud-core >= 2.0.0, <3.0.0", "grpcio >= 1.59.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", - "proto-plus >= 1.26.1, <2.0.0", - "protobuf >= 6.33.5, < 8.0.0", + "proto-plus >= 1.22.3, <2.0.0", + "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", + "protobuf >= 4.25.8, < 8.0.0", ] extras = {} url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-datastore" diff --git a/packages/google-cloud-datastore/testing/constraints-3.10.txt b/packages/google-cloud-datastore/testing/constraints-3.10.txt index 81605a716d32..7be9c36933fc 100644 --- a/packages/google-cloud-datastore/testing/constraints-3.10.txt +++ b/packages/google-cloud-datastore/testing/constraints-3.10.txt @@ -4,8 +4,8 @@ # pinning their versions to their lower bounds. # For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", # then this file should have google-cloud-foo==1.14.0 -google-api-core==2.24.2 +google-api-core==2.17.1 google-auth==2.14.1 grpcio==1.59.0 -proto-plus==1.26.1 -protobuf==6.33.5 +proto-plus==1.22.3 +protobuf==4.25.8 diff --git a/packages/google-cloud-datastore/testing/constraints-3.13.txt b/packages/google-cloud-datastore/testing/constraints-3.13.txt index 6bd7e1f5b03d..1e93c60e50aa 100644 --- a/packages/google-cloud-datastore/testing/constraints-3.13.txt +++ b/packages/google-cloud-datastore/testing/constraints-3.13.txt @@ -9,4 +9,4 @@ google-api-core>=2 google-auth>=2 grpcio>=1 proto-plus>=1 -protobuf>=7 +protobuf>=6 diff --git a/packages/google-cloud-datastore/testing/constraints-3.14.txt b/packages/google-cloud-datastore/testing/constraints-3.14.txt index 6bd7e1f5b03d..1e93c60e50aa 100644 --- a/packages/google-cloud-datastore/testing/constraints-3.14.txt +++ b/packages/google-cloud-datastore/testing/constraints-3.14.txt @@ -9,4 +9,4 @@ google-api-core>=2 google-auth>=2 grpcio>=1 proto-plus>=1 -protobuf>=7 +protobuf>=6