Skip to content

Commit f25d768

Browse files
committed
chore(generator): add local google-api-core path override to noxfile showcase tests
Injects local workspace path override for google-api-core package to allow running showcase unit tests successfully when new changes are introduced to api-core.
1 parent 7d5da69 commit f25d768

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

packages/gapic-generator/noxfile.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
from os import path
3131
import shutil
3232

33+
CURRENT_DIRECTORY = Path(__file__).parent.absolute()
34+
3335

3436
nox.options.error_on_missing_interpreters = True
3537

@@ -351,6 +353,14 @@ def showcase_library(
351353
external=True,
352354
)
353355

356+
google_api_core_dir = next(
357+
(str(p / "packages" / "google-api-core") for p in CURRENT_DIRECTORY.parents if (p / "packages" / "google-api-core").exists()),
358+
None
359+
)
360+
if google_api_core_dir:
361+
session.run("pip", "uninstall", "google-api-core", "-y")
362+
session.install("-e", google_api_core_dir, "--no-deps")
363+
354364
# Install the generated showcase library.
355365
if templates == "DEFAULT":
356366
# Use the constraints file for the specific python runtime version.

0 commit comments

Comments
 (0)