Skip to content

Commit 56a75c8

Browse files
authored
fix: revert to using importlib for dynamic module loading (#326)
1 parent 27b8a01 commit 56a75c8

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

autorelease/trigger.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414

1515
"""This module handles triggering Kokoro release jobs for merged release pull requests."""
1616

17+
import importlib
18+
1719
from autorelease import common, github, kokoro, reporter
18-
from releasetool.commands import tag
1920

2021
LANGUAGE_ALLOWLIST = ["java"]
2122
ORGANIZATIONS_TO_SCAN = ["googleapis", "GoogleCloudPlatform"]
@@ -56,7 +57,7 @@ def trigger_kokoro_build_for_pull_request(
5657
result.print(f"Language {lang} not in allowlist, skipping.")
5758
return
5859

59-
language_module = getattr(tag, lang)
60+
language_module = importlib.import_module(f"releasetool.commands.tag.{lang}")
6061
package_name = language_module.package_name(pull)
6162
kokoro_job_name = language_module.kokoro_job_name(
6263
pull["base"]["repo"]["full_name"], package_name

0 commit comments

Comments
 (0)