3131from conda_forge_tick .feedstock_parser import BOOTSTRAP_MAPPINGS
3232from conda_forge_tick .git_utils import (
3333 DryRunBackend ,
34- DuplicatePullRequestError ,
3534 GitCli ,
3635 GitCliError ,
3736 GitPlatformBackend ,
3837 RepositoryNotFoundError ,
3938 github_backend ,
40- is_github_api_limit_reached ,
39+ is_github_api_limit_reached , DuplicatePullRequestError ,
4140)
4241from conda_forge_tick .lazy_json_backends import (
4342 LazyJson ,
5150 PR_LIMIT ,
5251 load_migrators ,
5352)
54- from conda_forge_tick .migration_runner import run_migration
55- from conda_forge_tick .migrators import MigrationYaml , Migrator , Version
53+ from conda_forge_tick .migrators import Migrator , Version , MigrationYaml
5654from conda_forge_tick .migrators .version import VersionMigrationError
5755from conda_forge_tick .os_utils import eval_cmd
5856from conda_forge_tick .rerender_feedstock import rerender_feedstock
6967 load_existing_graph ,
7068 sanitize_string ,
7169)
70+ from .migration_runner import run_migration
7271
7372from .migrators_types import MigrationUidTypedDict
7473from .models .pr_json import PullRequestData , PullRequestInfoSpecial , PullRequestState
@@ -849,10 +848,11 @@ def _run_migrator_on_feedstock_branch(
849848 return good_prs , break_loop
850849
851850
852- def _is_migrator_done (_mg_start , good_prs , time_per , pr_limit ):
851+ def _is_migrator_done (
852+ _mg_start , good_prs , time_per , pr_limit , git_backend : GitPlatformBackend
853+ ):
853854 curr_time = time .time ()
854- backend = github_backend ()
855- api_req = backend .get_api_requests_left ()
855+ api_req = git_backend .get_api_requests_left ()
856856
857857 if curr_time - START_TIME > TIMEOUT :
858858 logger .info (
@@ -930,7 +930,7 @@ def _run_migrator(
930930
931931 if package :
932932 if package not in possible_nodes :
933- logger .warning (
933+ logger .info (
934934 f"Package { package } is not a candidate for migration of { migrator_name } "
935935 )
936936 return 0
@@ -968,7 +968,9 @@ def _run_migrator(
968968 flush = True ,
969969 )
970970
971- if _is_migrator_done (_mg_start , good_prs , time_per , migrator .pr_limit ):
971+ if _is_migrator_done (
972+ _mg_start , good_prs , time_per , migrator .pr_limit , git_backend
973+ ):
972974 return 0
973975
974976 for node_name in possible_nodes :
@@ -985,7 +987,9 @@ def _run_migrator(
985987 ):
986988 # Don't let CI timeout, break ahead of the timeout so we make certain
987989 # to write to the repo
988- if _is_migrator_done (_mg_start , good_prs , time_per , migrator .pr_limit ):
990+ if _is_migrator_done (
991+ _mg_start , good_prs , time_per , migrator .pr_limit , git_backend
992+ ):
989993 break
990994
991995 base_branches = migrator .get_possible_feedstock_branches (attrs )
@@ -1334,7 +1338,7 @@ def main(ctx: CliContext, package: str | None = None) -> None:
13341338
13351339 for mg_ind , migrator in enumerate (migrators ):
13361340 good_prs = _run_migrator (
1337- migrator , mctx , temp , time_per_migrator [mg_ind ], git_backend
1341+ migrator , mctx , temp , time_per_migrator [mg_ind ], git_backend , package
13381342 )
13391343 if good_prs > 0 :
13401344 pass
@@ -1349,5 +1353,5 @@ def main(ctx: CliContext, package: str | None = None) -> None:
13491353 # ],
13501354 # )
13511355
1352- logger .info ("API Calls Remaining: %d" , github_backend () .get_api_requests_left ())
1356+ logger .info (f "API Calls Remaining: { git_backend .get_api_requests_left ()} " )
13531357 logger .info ("Done" )
0 commit comments