Repository: googleapis/python-pubsub (language: python)

Issue:
Unable to use patched version of grpcio with google-cloud-pubsub
There are a number of bugs (functionally and security wise) in grpcio < 1.63. However, >1.63 now requires >5 protobuf, but this library requires protobuf <5 making it no longer possible to install this library with a patched working version of grpcio.

```
Because no versions of google-cloud-pubsub match >2.21.3
 and google-cloud-pubsub (2.21.3) depends on protobuf (>=3.19.5,<3.20.0 || >3.20.0,<3.20.1 || >3.20.1,<4.21.0 || >4.21.0,<4.21.1 || >4.21.1,<4.21.2 || >4.21.2,<4.21.3 || >4.21.3,<4.21.4 || >4.21.4,<4.21.5 || >4.21.5,<5.0.0dev), google-cloud-pubsub (>=2.21.3) requires protobuf (>=3.19.5,<3.20.0 || >3.20.0,<3.20.1 || >3.20.1,<4.21.0 || >4.21.0,<4.21.1 || >4.21.1,<4.21.2 || >4.21.2,<4.21.3 || >4.21.3,<4.21.4 || >4.21.4,<4.21.5 || >4.21.5,<5.0.0dev).
Because grpcio (1.64.1) depends on protobuf (>=5.26.1,<6.0dev)
 and no versions of grpcio match >1.64.1,<2.0.0, grpcio (>=1.64.1,<2.0.0) requires protobuf (>=5.26.1,<6.0dev).
Thus, google-cloud-pubsub (>=2.21.3) is incompatible with grpcio (>=1.64.1,<2.0.0).
```

Can support for a newer version of protobuf be included in this library?


Discussion / hints:

Fix patch:
diff --git a/setup.py b/setup.py
index a6af31207..dbb66cf7c 100644
--- a/setup.py
+++ b/setup.py
@@ -42,7 +42,7 @@
     "google-api-core[grpc] >= 1.34.0, <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.*",
     "proto-plus >= 1.22.0, <2.0.0dev",
     "proto-plus >= 1.22.2, <2.0.0dev; python_version>='3.11'",
-    "protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5",
+    "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",
     "grpc-google-iam-v1 >= 0.12.4, < 1.0.0dev",
     "grpcio-status >= 1.33.2",
 ]


Test patch:
diff --git a/pytest.ini b/pytest.ini
index 865897dd5..34f393316 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -17,4 +17,6 @@ filterwarnings =
     # Added to suppress "DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html"
     # Remove once the minimum supported version of googleapis-common-protos is 1.62.0
     ignore:.*pkg_resources.declare_namespace:DeprecationWarning
-    ignore:.*pkg_resources is deprecated as an API:DeprecationWarning
\ No newline at end of file
+    ignore:.*pkg_resources is deprecated as an API:DeprecationWarning
+    # Remove once https://github.com/googleapis/python-pubsub/issues/1206 is fixed.
+    ignore:.*connections\(\) is deprecated and will be removed; use net_connections\(\) instead:DeprecationWarning
\ No newline at end of file
diff --git a/testing/constraints-3.7.txt b/testing/constraints-3.7.txt
index ee447eb62..08db5de87 100644
--- a/testing/constraints-3.7.txt
+++ b/testing/constraints-3.7.txt
@@ -7,7 +7,7 @@
 google-api-core==1.34.0
 google-auth==2.14.1
 proto-plus==1.22.0
-protobuf==3.19.5
+protobuf==3.20.2
 grpc-google-iam-v1==0.12.4
 grpcio==1.51.3
 grpcio-status==1.33.2