Skip to content

Commit

Permalink
chore(revert): revert update grpc extra to require grpcio >= 1.51.3 (#…
Browse files Browse the repository at this point in the history
…196)

* chore(revert): update grpc extra to require grpcio >= 1.51.3

This reverts commit 593af53.

* Revert "update testing/constraints-3.9.txt"

This reverts commit b529885.

* cater for python-pubsub grpcio requirement

* fix build

* fix build

* fix build

* fix build
  • Loading branch information
parthea committed Dec 1, 2023
1 parent 4b0c73a commit 1595731
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 13 deletions.
31 changes: 23 additions & 8 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,25 @@ def lint_setup_py(session):
session.run("python", "setup.py", "check", "--strict")


def default(session):
def default(session, repository=None):
# Install all test dependencies, then install this package in-place.
session.install("asyncmock", "pytest-asyncio")

# Pin mock due to https://github.com/googleapis/python-pubsub/issues/840
session.install("mock==5.0.0", "pytest", "pytest-cov")
session.install("-e", ".")

# Use the repository specific constraints path if it exists
constraints_path = str(
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}-{repository}.txt"
)

# If there is no repository specific constraints path, use the default one.
if not Path(constraints_path).exists():
constraints_path = str(
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
)

# Install googleapis-api-common-protos
# This *must* be the last install command to get the package from source.
session.install("-e", ".", "-c", constraints_path)
Expand All @@ -78,12 +85,12 @@ def default(session):
)


def unit(session):
def unit(session, repository=None):
"""Run the unit test suite."""
default(session)
default(session, repository)


def system(session):
def system(session, repository=None):
"""Run the system test suite."""
system_test_path = os.path.join("tests", "system.py")
system_test_folder_path = os.path.join("tests", "system")
Expand All @@ -107,10 +114,18 @@ def system(session):

session.install("-e", ".")

# Use the repository specific constraints path if it exists
constraints_path = str(
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}-{repository}.txt"
)

# If there is no repository specific constraints path, use the default one.
if not Path(constraints_path).exists():
constraints_path = str(
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
)


# Install googleapis-api-common-protos
# This *must* be the last install command to get the package from source.
session.install("-e", ".", "-c", constraints_path)
Expand Down Expand Up @@ -160,14 +175,14 @@ def test(session, library):
if package:
session.cd(f'packages/{package}')

unit(session)
unit(session, repository)

# system tests are run on 3.7 only
if session.python == "3.7":
if repository == "python-pubsub":
session.install("psutil")
session.install("flaky")
system(session)
system(session, repository)

@nox.session(python=["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"])
def tests_local(session):
Expand Down
4 changes: 1 addition & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@
"protobuf>=3.19.5,<5.0.0.dev0,!=3.20.0,!=3.20.1,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5",
]

# Require grpcio >= 1.51.3 for compatibility with Mac M1
# https://github.com/googleapis/python-pubsub/pull/900
extras_require = {"grpc": ["grpcio >= 1.51.3, <2.0.0.dev0"]}
extras_require = {"grpc": ["grpcio >= 1.44.0, <2.0.0.dev0"]}

package_root = os.path.abspath(os.path.dirname(__file__))

Expand Down
9 changes: 9 additions & 0 deletions testing/constraints-3.7-python-pubsub.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# 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 "foo >= 1.14.0, < 2.0.0dev",
# Then this file should have foo==1.14.0
protobuf==3.19.5
grpcio==1.51.3
2 changes: 1 addition & 1 deletion testing/constraints-3.7.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev",
# Then this file should have foo==1.14.0
protobuf==3.19.5
grpcio==1.51.3
grpcio==1.44.0
9 changes: 9 additions & 0 deletions testing/constraints-3.9-python-pubsub.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# 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 "foo >= 1.14.0, < 2.0.0dev",
# Then this file should have foo==1.14.0
protobuf==3.20.2
grpcio==1.51.3
2 changes: 1 addition & 1 deletion testing/constraints-3.9.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev",
# Then this file should have foo==1.14.0
protobuf==3.20.2
grpcio==1.51.3
grpcio==1.44.0

0 comments on commit 1595731

Please sign in to comment.