Skip to content

Commit c1d30d5

Browse files
committed
update noxfile
1 parent 4b1121e commit c1d30d5

1 file changed

Lines changed: 42 additions & 7 deletions

File tree

packages/google-cloud-pubsub/noxfile.py

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]
2828

29-
MYPY_VERSION = "mypy==1.10.0"
3029
# Add samples to the list of directories to format if the directory exists.
3130
if os.path.isdir("samples"):
3231
LINT_PATHS.append("samples")
@@ -105,6 +104,8 @@
105104
nox.options.error_on_missing_interpreters = True
106105

107106

107+
MYPY_VERSION = "mypy==1.10.0"
108+
108109
@nox.session(python=DEFAULT_PYTHON_VERSION)
109110
def mypy(session):
110111
"""Run type checks with mypy."""
@@ -152,6 +153,36 @@ def mypy_samples(session):
152153
"--no-incremental", # Required by warn-unused-configs from mypy.ini to work
153154
"samples/",
154155
)
156+
@nox.session
157+
def update_lower_bounds(session):
158+
"""Update lower bounds in constraints.txt to match setup.py"""
159+
session.install("google-cloud-testutils")
160+
session.install(".")
161+
162+
session.run(
163+
"lower-bound-checker",
164+
"update",
165+
"--package-name",
166+
PACKAGE_NAME,
167+
"--constraints-file",
168+
str(LOWER_BOUND_CONSTRAINTS_FILE),
169+
)
170+
171+
172+
@nox.session
173+
def check_lower_bounds(session):
174+
"""Check lower bounds in setup.py are reflected in constraints file"""
175+
session.install("google-cloud-testutils")
176+
session.install(".")
177+
178+
session.run(
179+
"lower-bound-checker",
180+
"check",
181+
"--package-name",
182+
PACKAGE_NAME,
183+
"--constraints-file",
184+
str(LOWER_BOUND_CONSTRAINTS_FILE),
185+
)
155186

156187

157188
@nox.session(python=DEFAULT_PYTHON_VERSION)
@@ -272,6 +303,8 @@ def unit(session, protobuf_implementation):
272303
if session.python in ["3.7", "3.8"]:
273304
session.skip(f"Python {session.python} is no longer supported.")
274305

306+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2388):
307+
# Remove this check once support for Protobuf 3.x is dropped.
275308
if protobuf_implementation == "cpp" and session.python in (
276309
"3.11",
277310
"3.12",
@@ -520,18 +553,20 @@ def prerelease_deps(session, protobuf_implementation):
520553
)
521554
]
522555

556+
# Install dependencies specified in `testing/constraints-X.txt`.
523557
session.install(*constraints_deps)
524558

559+
# Note: If a dependency is added to the `prerel_deps` list,
560+
# the `core_dependencies_from_source` list in the `core_deps_from_source`
561+
# nox session should also be updated.
525562
prerel_deps = [
526-
"protobuf",
527-
# dependency of grpc
528-
"six",
529-
"grpc-google-iam-v1",
530563
"googleapis-common-protos",
531-
"grpcio",
532-
"grpcio-status",
533564
"google-api-core",
534565
"google-auth",
566+
"grpc-google-iam-v1",
567+
"grpcio",
568+
"grpcio-status",
569+
"protobuf",
535570
"proto-plus",
536571
"google-cloud-testutils",
537572
# dependencies of google-cloud-testutils"

0 commit comments

Comments
 (0)