From 74fe47ee2d4fcbc701f231ced0f6e1c768a0f273 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Wed, 26 Jun 2024 23:17:41 -0500 Subject: [PATCH 1/2] Don't send a PR for arch migrations if build_platform is in conda-forge.yml --- conda_forge_tick/migrators/arch.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/conda_forge_tick/migrators/arch.py b/conda_forge_tick/migrators/arch.py index bfe81dd6f..fae7062ce 100644 --- a/conda_forge_tick/migrators/arch.py +++ b/conda_forge_tick/migrators/arch.py @@ -180,17 +180,17 @@ def __init__( def filter(self, attrs: "AttrsTypedDict", not_bad_str_start: str = "") -> bool: if super().filter(attrs): return True - muid = frozen_to_json_friendly(self.migrator_uid(attrs)) for arch in self.arches: configured_arch = ( attrs.get("conda-forge.yml", {}).get("provider", {}).get(arch) + ) or ( + attrs.get("conda-forge.yml", {}).get("build_platform", {}).get(arch) not in [None, arch] ) - if configured_arch: - return muid in _sanitized_muids( - attrs.get("pr_info", {}).get("PRed", []), - ) - else: - return False + if not configured_arch: + # This arch is not in provider or build_platform + return False + + return True def migrate( self, recipe_dir: str, attrs: "AttrsTypedDict", **kwargs: Any @@ -347,17 +347,17 @@ def __init__( def filter(self, attrs: "AttrsTypedDict", not_bad_str_start: str = "") -> bool: if super().filter(attrs): return True - muid = frozen_to_json_friendly(self.migrator_uid(attrs)) for arch in self.arches: configured_arch = ( attrs.get("conda-forge.yml", {}).get("provider", {}).get(arch) + ) or ( + attrs.get("conda-forge.yml", {}).get("build_platform", {}).get(arch) not in [None, arch] ) - if configured_arch: - return muid in _sanitized_muids( - attrs.get("pr_info", {}).get("PRed", []), - ) - else: - return False + if not configured_arch: + # This arch is not in provider or build_platform + return False + + return True def migrate( self, recipe_dir: str, attrs: "AttrsTypedDict", **kwargs: Any From 1c0fee828a6ff795e38267a871f600dc1037d04d Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Thu, 27 Jun 2024 18:31:11 -0500 Subject: [PATCH 2/2] pre-commit --- conda_forge_tick/migrators/arch.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/conda_forge_tick/migrators/arch.py b/conda_forge_tick/migrators/arch.py index fae7062ce..67f80bbbb 100644 --- a/conda_forge_tick/migrators/arch.py +++ b/conda_forge_tick/migrators/arch.py @@ -9,15 +9,9 @@ get_deps_from_outputs_lut, make_outputs_lut_from_graph, ) -from conda_forge_tick.migrators.core import GraphMigrator, _sanitized_muids +from conda_forge_tick.migrators.core import GraphMigrator from conda_forge_tick.os_utils import pushd -from conda_forge_tick.utils import ( - as_iterable, - frozen_to_json_friendly, - pluck, - yaml_safe_dump, - yaml_safe_load, -) +from conda_forge_tick.utils import as_iterable, pluck, yaml_safe_dump, yaml_safe_load from .migration_yaml import all_noarch @@ -184,7 +178,8 @@ def filter(self, attrs: "AttrsTypedDict", not_bad_str_start: str = "") -> bool: configured_arch = ( attrs.get("conda-forge.yml", {}).get("provider", {}).get(arch) ) or ( - attrs.get("conda-forge.yml", {}).get("build_platform", {}).get(arch) not in [None, arch] + attrs.get("conda-forge.yml", {}).get("build_platform", {}).get(arch) + not in [None, arch] ) if not configured_arch: # This arch is not in provider or build_platform @@ -351,7 +346,8 @@ def filter(self, attrs: "AttrsTypedDict", not_bad_str_start: str = "") -> bool: configured_arch = ( attrs.get("conda-forge.yml", {}).get("provider", {}).get(arch) ) or ( - attrs.get("conda-forge.yml", {}).get("build_platform", {}).get(arch) not in [None, arch] + attrs.get("conda-forge.yml", {}).get("build_platform", {}).get(arch) + not in [None, arch] ) if not configured_arch: # This arch is not in provider or build_platform