|
37 | 37 | BLACK_EXCLUDES = "|".join([".*golden.*", ".*pb2.py"]) |
38 | 38 |
|
39 | 39 | ALL_PYTHON = ( |
40 | | - "3.7", |
41 | | - "3.8", |
42 | 40 | "3.9", |
43 | 41 | "3.10", |
44 | 42 | "3.11", |
@@ -170,17 +168,11 @@ def fragment(session, use_ads_templates=False): |
170 | 168 | "pytest", |
171 | 169 | "pytest-cov", |
172 | 170 | "pytest-xdist", |
173 | | - "asyncmock; python_version < '3.8'", |
174 | 171 | "pytest-asyncio", |
175 | 172 | "grpcio-tools", |
176 | 173 | ) |
177 | | - session.install("-e", ".") |
178 | | - |
179 | | - # TODO(https://github.com/googleapis/gapic-generator-python/issues/2473): |
180 | | - # Warnings emitted from google-api-core starting in 2.28 |
181 | | - # appear to cause issues when running protoc. |
182 | 174 | # The specific failure is `Plugin output is unparseable` |
183 | | - if session.python in ("3.7", "3.8", "3.9", "3.10"): |
| 175 | + if session.python in ("3.9", "3.10"): |
184 | 176 | session.install("google-api-core<2.28") |
185 | 177 |
|
186 | 178 | frag_files = ( |
@@ -250,7 +242,7 @@ def showcase_library( |
250 | 242 | # Warnings emitted from google-api-core starting in 2.28 |
251 | 243 | # appear to cause issues when running protoc. |
252 | 244 | # The specific failure is `Plugin output is unparseable` |
253 | | - if session.python in ("3.7", "3.8", "3.9", "3.10"): |
| 245 | + if session.python in ("3.9", "3.10"): |
254 | 246 | session.install("google-api-core<2.28") |
255 | 247 |
|
256 | 248 | # Install a client library for Showcase. |
@@ -357,40 +349,20 @@ def showcase_library( |
357 | 349 | f"{tmp_dir}/testing/constraints-{session.python}.txt" |
358 | 350 | ) |
359 | 351 | # Install the library with a constraints file. |
360 | | - if session.python == "3.7": |
361 | | - session.install("-e", tmp_dir, "-r", constraints_path) |
362 | | - if rest_async_io_enabled: |
363 | | - # NOTE: We re-install `google-api-core` and `google-auth` to override the respective |
364 | | - # versions for each specified in constraints-3.7.txt. This is needed because async REST |
365 | | - # is not supported with the minimum version of `google-api-core` and `google-auth`. |
366 | | - # TODO(https://github.com/googleapis/gapic-generator-python/issues/2211): Remove hardcoded dependencies |
367 | | - # from here and add a new constraints file for testing the minimum supported versions for async REST feature. |
368 | | - session.install( |
369 | | - "--no-cache-dir", |
370 | | - "--force-reinstall", |
371 | | - "google-api-core[grpc, async_rest]==2.21.0", |
372 | | - ) |
373 | | - # session.install('--no-cache-dir', '--force-reinstall', "google-api-core==2.20.0") |
374 | | - session.install( |
375 | | - "--no-cache-dir", |
376 | | - "--force-reinstall", |
377 | | - "google-auth[aiohttp]==2.35.0", |
378 | | - ) |
379 | | - else: |
380 | | - session.install( |
381 | | - "-e", |
382 | | - tmp_dir + ("[async_rest]" if rest_async_io_enabled else ""), |
383 | | - "-r", |
384 | | - constraints_path, |
385 | | - ) |
386 | | - # Exclude `google-auth==2.40.0` which contains a regression |
387 | | - # https://github.com/googleapis/gapic-generator-python/issues/2385 |
388 | | - session.install( |
389 | | - "--no-cache-dir", |
390 | | - "--force-reinstall", |
391 | | - "--upgrade", |
392 | | - "google-auth[aiohttp]!=2.40.0", |
393 | | - ) |
| 352 | + session.install( |
| 353 | + "-e", |
| 354 | + tmp_dir + ("[async_rest]" if rest_async_io_enabled else ""), |
| 355 | + "-r", |
| 356 | + constraints_path, |
| 357 | + ) |
| 358 | + # Exclude `google-auth==2.40.0` which contains a regression |
| 359 | + # https://github.com/googleapis/gapic-generator-python/issues/2385 |
| 360 | + session.install( |
| 361 | + "--no-cache-dir", |
| 362 | + "--force-reinstall", |
| 363 | + "--upgrade", |
| 364 | + "google-auth[aiohttp]!=2.40.0", |
| 365 | + ) |
394 | 366 | else: |
395 | 367 | # The ads templates do not have constraints files. |
396 | 368 | # See https://github.com/googleapis/gapic-generator-python/issues/1788 |
@@ -497,41 +469,23 @@ def run_showcase_unit_tests(session, fail_under=100, rest_async_io_enabled=False |
497 | 469 | "pytest", |
498 | 470 | "pytest-cov", |
499 | 471 | "pytest-xdist", |
500 | | - "asyncmock; python_version < '3.8'", |
501 | 472 | "pytest-asyncio", |
502 | 473 | ) |
503 | 474 | # Run the tests. |
504 | | - # NOTE: async rest is not supported against the minimum supported version of google-api-core. |
505 | | - # Therefore, we ignore the coverage requirement in this case. |
506 | | - if session.python == "3.7" and rest_async_io_enabled: |
507 | | - session.run( |
508 | | - "py.test", |
509 | | - *( |
510 | | - session.posargs |
511 | | - or [ |
512 | | - "-n=auto", |
513 | | - "--quiet", |
514 | | - "--cov=google", |
515 | | - "--cov-append", |
516 | | - path.join("tests", "unit"), |
517 | | - ] |
518 | | - ), |
519 | | - ) |
520 | | - else: |
521 | | - session.run( |
522 | | - "py.test", |
523 | | - *( |
524 | | - session.posargs |
525 | | - or [ |
526 | | - "-n=auto", |
527 | | - "--quiet", |
528 | | - "--cov=google", |
529 | | - "--cov-append", |
530 | | - f"--cov-fail-under={str(fail_under)}", |
531 | | - path.join("tests", "unit"), |
532 | | - ] |
533 | | - ), |
534 | | - ) |
| 475 | + session.run( |
| 476 | + "py.test", |
| 477 | + *( |
| 478 | + session.posargs |
| 479 | + or [ |
| 480 | + "-n=auto", |
| 481 | + "--quiet", |
| 482 | + "--cov=google", |
| 483 | + "--cov-append", |
| 484 | + f"--cov-fail-under={str(fail_under)}", |
| 485 | + path.join("tests", "unit"), |
| 486 | + ] |
| 487 | + ), |
| 488 | + ) |
535 | 489 |
|
536 | 490 |
|
537 | 491 | @nox.session(python=ALL_PYTHON) |
|
0 commit comments