Skip to content

Commit 4fed37c

Browse files
authored
fix(deps): Require proto-plus >= 1.22.3 (#626)
* fix(deps): add dependency on proto-plus * remove unused import
1 parent 475ff2e commit 4fed37c

File tree

4 files changed

+8
-31
lines changed

4 files changed

+8
-31
lines changed

noxfile.py

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,6 @@
4444
]
4545

4646

47-
def _greater_or_equal_than_37(version_string):
48-
tokens = version_string.split(".")
49-
for i, token in enumerate(tokens):
50-
try:
51-
tokens[i] = int(token)
52-
except ValueError:
53-
pass
54-
return tokens >= [3, 7]
55-
56-
5747
@nox.session(python=DEFAULT_PYTHON_VERSION)
5848
def lint(session):
5949
"""Run linters.
@@ -129,16 +119,13 @@ def default(session, install_grpc=True):
129119
),
130120
]
131121

132-
# Inject AsyncIO content and proto-plus, if version >= 3.7.
133-
# proto-plus is needed for a field mask test in test_protobuf_helpers.py
134-
if _greater_or_equal_than_37(session.python):
135-
session.install("asyncmock", "pytest-asyncio", "proto-plus")
122+
session.install("asyncmock", "pytest-asyncio")
136123

137-
# Having positional arguments means the user wants to run specific tests.
138-
# Best not to add additional tests to that list.
139-
if not session.posargs:
140-
pytest_args.append("--cov=tests.asyncio")
141-
pytest_args.append(os.path.join("tests", "asyncio"))
124+
# Having positional arguments means the user wants to run specific tests.
125+
# Best not to add additional tests to that list.
126+
if not session.posargs:
127+
pytest_args.append("--cov=tests.asyncio")
128+
pytest_args.append(os.path.join("tests", "asyncio"))
142129

143130
session.run(*pytest_args)
144131

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
dependencies = [
3232
"googleapis-common-protos >= 1.56.2, < 2.0.dev0",
3333
"protobuf>=3.19.5,<5.0.0.dev0,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5",
34+
"proto-plus >= 1.22.3, <2.0.0dev",
3435
"google-auth >= 2.14.1, < 3.0.dev0",
3536
"requests >= 2.18.0, < 3.0.0.dev0",
3637
]

testing/constraints-3.7.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ packaging==14.3
1313
grpcio==1.33.2
1414
grpcio-status==1.33.2
1515
grpcio-gcp==0.2.2
16+
proto-plus==1.22.3

tests/unit/test_protobuf_helpers.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
import sys
16-
1715
import pytest
1816

1917
from google.api import http_pb2
@@ -476,11 +474,6 @@ def test_field_mask_different_level_diffs():
476474
]
477475

478476

479-
@pytest.mark.skipif(
480-
sys.version_info.major == 2,
481-
reason="Field names with trailing underscores can only be created"
482-
"through proto-plus, which is Python 3 only.",
483-
)
484477
def test_field_mask_ignore_trailing_underscore():
485478
import proto
486479

@@ -496,11 +489,6 @@ class Foo(proto.Message):
496489
]
497490

498491

499-
@pytest.mark.skipif(
500-
sys.version_info.major == 2,
501-
reason="Field names with trailing underscores can only be created"
502-
"through proto-plus, which is Python 3 only.",
503-
)
504492
def test_field_mask_ignore_trailing_underscore_with_nesting():
505493
import proto
506494

0 commit comments

Comments
 (0)