Skip to content

Commit

Permalink
Bump minimum protobuf to 5.27.x
Browse files Browse the repository at this point in the history
  • Loading branch information
parthea committed Nov 15, 2024
1 parent 5fc7d97 commit d83a47b
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 44 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
# Run showcase tests on the lowest and highest supported runtimes
matrix:
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2121) Remove `showcase_w_rest_async` target when async rest is GA.
python: ["3.7", "3.13"]
python: ["3.8", "3.13"]
target: [showcase, showcase_alternative_templates, showcase_w_rest_async]
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -140,7 +140,7 @@ jobs:
showcase-unit:
strategy:
matrix:
python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
python: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2121) Remove `_w_rest_async` variant when async rest is GA.
variant: ['', _alternative_templates, _mixins, _alternative_templates_mixins, _w_rest_async]
runs-on: ubuntu-latest
Expand Down Expand Up @@ -240,7 +240,7 @@ jobs:
unit:
strategy:
matrix:
python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
python: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -261,7 +261,7 @@ jobs:
fragment:
strategy:
matrix:
python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
python: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
variant: ['', _alternative_templates]
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion gapic/templates/mypy.ini.j2
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[mypy]
python_version = 3.7
python_version = 3.8
namespace_packages = True
1 change: 0 additions & 1 deletion gapic/templates/noxfile.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import sys
import nox # type: ignore

ALL_PYTHON = [
"3.7",
"3.8",
"3.9",
"3.10",
Expand Down
13 changes: 7 additions & 6 deletions gapic/templates/setup.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,16 @@ else:
release_status = "Development Status :: 5 - Production/Stable"

dependencies = [
"google-api-core[grpc] >= 1.34.1, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*",
{# google-api-core >= 2.19.1 is needed for protobuf 5.x support #}
"google-api-core[grpc] >= 2.19.1, <3.0.0dev",
# Exclude incompatible versions of `google-auth`
# See https://github.com/googleapis/google-cloud-python/issues/12364
"google-auth >= 2.14.1, <3.0.0dev,!=2.24.0,!=2.25.0",
"proto-plus >= 1.22.3, <2.0.0dev",
{# proto-plus >= 1.24.0 is needed for protobuf 5.x support #}
"proto-plus >= 1.24.0, <2.0.0dev",
"proto-plus >= 1.25.0, <2.0.0dev; python_version >= '3.13'",
{# Explicitly exclude protobuf versions mentioned in https://cloud.google.com/support/bulletins#GCP-2022-019 #}
"protobuf>=3.20.2,<6.0.0dev,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5",
# protobuf >= 5.27.0 is needed which supports `google.protobuf.runtime_version`
"protobuf>=5.27.0,<6.0.0dev",
{% for package_tuple, package_info in pypi_packages.items() %}
{# Quick check to make sure the package is different from this setup.py #}
{% if api.naming.warehouse_package_name != package_info.package_name %}
Expand Down Expand Up @@ -86,7 +88,6 @@ setuptools.setup(
"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 @@ -98,7 +99,7 @@ setuptools.setup(
],
platforms="Posix; MacOS X; Windows",
packages=packages,
python_requires=">=3.7",
python_requires=">=3.8",
install_requires=dependencies,
extras_require=extras,
include_package_data=True,
Expand Down
19 changes: 0 additions & 19 deletions gapic/templates/testing/constraints-3.7.txt.j2

This file was deleted.

26 changes: 22 additions & 4 deletions gapic/templates/testing/constraints-3.8.txt.j2
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
# -*- coding: utf-8 -*-
{% block constraints %}
{% include "testing/_default_constraints.j2" %}
{% endblock %}
{% from '_pypi_packages.j2' import pypi_packages %}
# 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 "google-cloud-foo >= 1.14.0, < 2.0.0dev",
# Then this file should have google-cloud-foo==1.14.0
# google-api-core >= 2.19.1 is needed for protobuf 5.x support
google-api-core==2.19.1
google-auth==2.14.1
# proto-plus >= 1.24.0 is needed for protobuf 5.x support
proto-plus==1.24.0
# protobuf 5.27.0 is needed which supports `google.protobuf.runtime_version`
protobuf==5.27.2
{% for package_tuple, package_info in pypi_packages.items() %}
{# Quick check to make sure the package is different from this setup.py #}
{% if api.naming.warehouse_package_name != package_info.package_name %}
{% if api.requires_package(package_tuple) %}
{{ package_info.package_name }}=={{ package_info.lower_bound }}
{% endif %}
{% endif %}
{% endfor %}
2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[mypy]
python_version = 3.7
python_version = 3.8
7 changes: 3 additions & 4 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@


ALL_PYTHON = (
"3.7",
"3.8",
"3.9",
"3.10",
Expand Down Expand Up @@ -314,11 +313,11 @@ def showcase_library(
f"{tmp_dir}/testing/constraints-{session.python}.txt"
)
# Install the library with a constraints file.
if session.python == "3.7":
if session.python == "3.8":
session.install("-e", tmp_dir, "-r", constraints_path)
if rest_async_io_enabled:
# NOTE: We re-install `google-api-core` and `google-auth` to override the respective
# versions for each specified in constraints-3.7.txt. This is needed because async REST
# versions for each specified in constraints-3.8.txt. This is needed because async REST
# is not supported with the minimum version of `google-api-core` and `google-auth`.
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2211): Remove hardcoded dependencies
# from here and add a new constraints file for testing the minimum supported versions for async REST feature.
Expand Down Expand Up @@ -454,7 +453,7 @@ def run_showcase_unit_tests(session, fail_under=100, rest_async_io_enabled=False
# Run the tests.
# NOTE: async rest is not supported against the minimum supported version of google-api-core.
# Therefore, we ignore the coverage requirement in this case.
if session.python == "3.7" and rest_async_io_enabled:
if session.python == "3.8" and rest_async_io_enabled:
session.run(
"py.test",
*(
Expand Down
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@
# Ensure that the lower bounds of these dependencies match what we have in the
# templated setup.py.j2: https://github.com/googleapis/gapic-generator-python/blob/main/gapic/templates/setup.py.j2
"click >= 6.7",
"google-api-core[grpc] >= 1.34.1, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*",
# google-api-core >= 2.19.1 Required for protobuf 5.x support
"google-api-core[grpc] >= 2.19.1, <3.0.0dev",
"googleapis-common-protos >= 1.55.0",
"grpcio >= 1.24.3",
# 2.11.0 is required which adds the `default` argument to `jinja-filters.map()`
# https://jinja.palletsprojects.com/en/3.0.x/templates/#jinja-filters.map
# https://jinja.palletsprojects.com/en/2.11.x/changelog/#version-2-11-0
"jinja2 >= 2.11",
"protobuf>=3.20.2,<6.0.0dev,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5",
"protobuf>=5.27.0,<6.0.0dev",
"pypandoc >= 1.4",
"PyYAML >= 5.1.1",
"grpc-google-iam-v1 >= 0.12.4, < 1.0.0dev",
Expand Down Expand Up @@ -70,7 +71,6 @@
"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 @@ -82,7 +82,7 @@
"Topic :: Software Development :: Libraries :: Python Modules",
],
platforms="Posix; MacOS X",
python_requires=">=3.7",
python_requires=">=3.8",
install_requires=dependencies,
include_package_data=True,
zip_safe=False,
Expand Down

0 comments on commit d83a47b

Please sign in to comment.