|
67 | 67 | UNIT_TEST_PYTHON_VERSIONS = ["3.9", "3.10", "3.11", "3.12", "3.13"] |
68 | 68 | UNIT_TEST_STANDARD_DEPENDENCIES = [ |
69 | 69 | "mock", |
70 | | - "asyncmock", |
71 | 70 | PYTEST_VERSION, |
72 | | - "pytest-asyncio", |
73 | 71 | "pytest-cov", |
74 | | - "pytest-mock", |
75 | 72 | "pytest-timeout", |
76 | 73 | ] |
77 | | -UNIT_TEST_LOCAL_DEPENDENCIES: List[str] = [] |
78 | 74 | UNIT_TEST_DEPENDENCIES: List[str] = [] |
79 | 75 | UNIT_TEST_EXTRAS: List[str] = ["tests"] |
80 | 76 | UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = { |
|
106 | 102 | SYSTEM_TEST_EXTERNAL_DEPENDENCIES = [ |
107 | 103 | "google-cloud-bigquery", |
108 | 104 | ] |
109 | | -SYSTEM_TEST_LOCAL_DEPENDENCIES: List[str] = [] |
110 | | -SYSTEM_TEST_DEPENDENCIES: List[str] = [] |
111 | 105 | SYSTEM_TEST_EXTRAS: List[str] = ["tests"] |
112 | 106 | SYSTEM_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = { |
113 | 107 | # Make sure we leave some versions without "extras" so we know those |
@@ -206,20 +200,20 @@ def lint_setup_py(session): |
206 | 200 |
|
207 | 201 |
|
208 | 202 | 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 = [] |
215 | 204 | if install_test_extra: |
216 | 205 | if session.python in UNIT_TEST_EXTRAS_BY_PYTHON: |
217 | 206 | extras = UNIT_TEST_EXTRAS_BY_PYTHON[session.python] |
218 | 207 | else: |
219 | 208 | 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 | + ) |
223 | 217 |
|
224 | 218 |
|
225 | 219 | def run_unit(session, install_test_extra): |
@@ -308,33 +302,26 @@ def mypy(session): |
308 | 302 |
|
309 | 303 |
|
310 | 304 | 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 | | - |
327 | 305 | if install_test_extra and SYSTEM_TEST_EXTRAS_BY_PYTHON: |
328 | 306 | extras = SYSTEM_TEST_EXTRAS_BY_PYTHON.get(session.python, []) |
329 | 307 | elif install_test_extra and SYSTEM_TEST_EXTRAS: |
330 | 308 | extras = SYSTEM_TEST_EXTRAS |
331 | 309 | else: |
332 | 310 | extras = [] |
333 | 311 |
|
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 | + ) |
338 | 325 |
|
339 | 326 |
|
340 | 327 | def run_system( |
|
0 commit comments