Skip to content

Commit 73befac

Browse files
chore: Clean up nox test dependency installs
1 parent 248c8ea commit 73befac

File tree

1 file changed

+22
-35
lines changed

1 file changed

+22
-35
lines changed

noxfile.py

Lines changed: 22 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,10 @@
6767
UNIT_TEST_PYTHON_VERSIONS = ["3.9", "3.10", "3.11", "3.12", "3.13"]
6868
UNIT_TEST_STANDARD_DEPENDENCIES = [
6969
"mock",
70-
"asyncmock",
7170
PYTEST_VERSION,
72-
"pytest-asyncio",
7371
"pytest-cov",
74-
"pytest-mock",
7572
"pytest-timeout",
7673
]
77-
UNIT_TEST_LOCAL_DEPENDENCIES: List[str] = []
7874
UNIT_TEST_DEPENDENCIES: List[str] = []
7975
UNIT_TEST_EXTRAS: List[str] = ["tests"]
8076
UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {
@@ -106,8 +102,6 @@
106102
SYSTEM_TEST_EXTERNAL_DEPENDENCIES = [
107103
"google-cloud-bigquery",
108104
]
109-
SYSTEM_TEST_LOCAL_DEPENDENCIES: List[str] = []
110-
SYSTEM_TEST_DEPENDENCIES: List[str] = []
111105
SYSTEM_TEST_EXTRAS: List[str] = ["tests"]
112106
SYSTEM_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {
113107
# Make sure we leave some versions without "extras" so we know those
@@ -206,20 +200,20 @@ def lint_setup_py(session):
206200

207201

208202
def install_unittest_dependencies(session, install_test_extra, *constraints):
209-
standard_deps = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_DEPENDENCIES
210-
session.install(*standard_deps, *constraints)
211-
212-
if UNIT_TEST_LOCAL_DEPENDENCIES:
213-
session.install(*UNIT_TEST_LOCAL_DEPENDENCIES, *constraints)
214-
203+
extras = []
215204
if install_test_extra:
216205
if session.python in UNIT_TEST_EXTRAS_BY_PYTHON:
217206
extras = UNIT_TEST_EXTRAS_BY_PYTHON[session.python]
218207
else:
219208
extras = UNIT_TEST_EXTRAS
220-
session.install("-e", f".[{','.join(extras)}]", *constraints)
221-
else:
222-
session.install("-e", ".", *constraints)
209+
210+
session.install(
211+
*UNIT_TEST_STANDARD_DEPENDENCIES,
212+
*UNIT_TEST_DEPENDENCIES,
213+
"-e",
214+
f".[{','.join(extras)}]" if extras else ".",
215+
*constraints,
216+
)
223217

224218

225219
def run_unit(session, install_test_extra):
@@ -308,33 +302,26 @@ def mypy(session):
308302

309303

310304
def install_systemtest_dependencies(session, install_test_extra, *constraints):
311-
# Use pre-release gRPC for system tests.
312-
# Exclude version 1.49.0rc1 which has a known issue.
313-
# See https://github.com/grpc/grpc/pull/30642
314-
session.install("--pre", "grpcio!=1.49.0rc1")
315-
316-
session.install(*SYSTEM_TEST_STANDARD_DEPENDENCIES, *constraints)
317-
318-
if SYSTEM_TEST_EXTERNAL_DEPENDENCIES:
319-
session.install(*SYSTEM_TEST_EXTERNAL_DEPENDENCIES, *constraints)
320-
321-
if SYSTEM_TEST_LOCAL_DEPENDENCIES:
322-
session.install("-e", *SYSTEM_TEST_LOCAL_DEPENDENCIES, *constraints)
323-
324-
if SYSTEM_TEST_DEPENDENCIES:
325-
session.install("-e", *SYSTEM_TEST_DEPENDENCIES, *constraints)
326-
327305
if install_test_extra and SYSTEM_TEST_EXTRAS_BY_PYTHON:
328306
extras = SYSTEM_TEST_EXTRAS_BY_PYTHON.get(session.python, [])
329307
elif install_test_extra and SYSTEM_TEST_EXTRAS:
330308
extras = SYSTEM_TEST_EXTRAS
331309
else:
332310
extras = []
333311

334-
if extras:
335-
session.install("-e", f".[{','.join(extras)}]", *constraints)
336-
else:
337-
session.install("-e", ".", *constraints)
312+
# Use pre-release gRPC for system tests.
313+
# Exclude version 1.49.0rc1 which has a known issue.
314+
# See https://github.com/grpc/grpc/pull/30642
315+
316+
session.install(
317+
"--pre",
318+
"grpcio!=1.49.0rc1",
319+
*SYSTEM_TEST_STANDARD_DEPENDENCIES,
320+
*SYSTEM_TEST_EXTERNAL_DEPENDENCIES,
321+
"-e",
322+
f".[{','.join(extras)}]" if extras else ".",
323+
*constraints,
324+
)
338325

339326

340327
def run_system(

0 commit comments

Comments
 (0)