From e0926b163de0db059335ff17e5210a316acc9854 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Sat, 7 Sep 2024 17:09:28 -0500 Subject: [PATCH 1/5] Fix filter for ucrt --- conda_forge_tick/migrators/r_ucrt.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conda_forge_tick/migrators/r_ucrt.py b/conda_forge_tick/migrators/r_ucrt.py index 1b69844cf..0c1bbaa1b 100644 --- a/conda_forge_tick/migrators/r_ucrt.py +++ b/conda_forge_tick/migrators/r_ucrt.py @@ -16,6 +16,7 @@ def _cleanup_raw_yaml(raw_yaml): line = line.replace("{{native}}", "") line = line.replace("{{posix}}pkg-config", "pkg-config") line = line.replace("{{ posix }}pkg-config", "pkg-config") + line = line.replace("- m2w64-pkg-config", "pkg-config") line = line.replace("- m2w64-toolchain", "- {{ compiler('m2w64_c') }}") if "merge_build_host: " in line: continue @@ -44,7 +45,7 @@ class RUCRTCleanup(MiniMigrator): """Cleanup the R recipes for ucrt""" def filter(self, attrs: "AttrsTypedDict", not_bad_str_start: str = "") -> bool: - return "native" not in attrs.get("raw_meta_yaml", "") + return not any(w in attrs.get("raw_meta_yaml", "") for w in ["native", "- posix", "- m2w64"]) def migrate(self, recipe_dir: str, attrs: "AttrsTypedDict", **kwargs: Any) -> None: with pushd(recipe_dir): From 882f013e0c3fe644d0a4ee62355080df96d64050 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Sat, 7 Sep 2024 22:36:23 -0500 Subject: [PATCH 2/5] pre-commit --- conda_forge_tick/migrators/r_ucrt.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/conda_forge_tick/migrators/r_ucrt.py b/conda_forge_tick/migrators/r_ucrt.py index 0c1bbaa1b..da42fe83d 100644 --- a/conda_forge_tick/migrators/r_ucrt.py +++ b/conda_forge_tick/migrators/r_ucrt.py @@ -45,7 +45,10 @@ class RUCRTCleanup(MiniMigrator): """Cleanup the R recipes for ucrt""" def filter(self, attrs: "AttrsTypedDict", not_bad_str_start: str = "") -> bool: - return not any(w in attrs.get("raw_meta_yaml", "") for w in ["native", "- posix", "- m2w64"]) + return not any( + w in attrs.get("raw_meta_yaml", "") + for w in ["native", "- posix", "- m2w64"] + ) def migrate(self, recipe_dir: str, attrs: "AttrsTypedDict", **kwargs: Any) -> None: with pushd(recipe_dir): From 9c2d443808e4f08216bac8853a232a86a635f89a Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Sat, 7 Sep 2024 23:16:47 -0500 Subject: [PATCH 3/5] replace posix with m2-base --- conda_forge_tick/migrators/r_ucrt.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/conda_forge_tick/migrators/r_ucrt.py b/conda_forge_tick/migrators/r_ucrt.py index da42fe83d..03c37e3b2 100644 --- a/conda_forge_tick/migrators/r_ucrt.py +++ b/conda_forge_tick/migrators/r_ucrt.py @@ -23,7 +23,10 @@ def _cleanup_raw_yaml(raw_yaml): if "- gcc-libs" in line: continue if "- posix" in line: - continue + if "set posix" in raw_yaml: + line = line.replace("- posix", "- {{ posix }}base") + else: + line = line.replace("- posix", "- m2-base") if "set native =" in line: continue if re.search(r"\s*skip: (T|t)rue\s+\# \[win\]", line): From cab82dc19f2625f9ade325a5715b0c3334768d7c Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Sat, 7 Sep 2024 23:20:01 -0500 Subject: [PATCH 4/5] simplify --- conda_forge_tick/migrators/r_ucrt.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/conda_forge_tick/migrators/r_ucrt.py b/conda_forge_tick/migrators/r_ucrt.py index 03c37e3b2..1c71e3218 100644 --- a/conda_forge_tick/migrators/r_ucrt.py +++ b/conda_forge_tick/migrators/r_ucrt.py @@ -23,10 +23,7 @@ def _cleanup_raw_yaml(raw_yaml): if "- gcc-libs" in line: continue if "- posix" in line: - if "set posix" in raw_yaml: - line = line.replace("- posix", "- {{ posix }}base") - else: - line = line.replace("- posix", "- m2-base") + line = line.replace("- posix", "- m2-base") if "set native =" in line: continue if re.search(r"\s*skip: (T|t)rue\s+\# \[win\]", line): From 0634ed5d1fc4bc645cc066d75c208b93f9b306b2 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Sat, 7 Sep 2024 23:21:02 -0500 Subject: [PATCH 5/5] simplify 2 --- conda_forge_tick/migrators/r_ucrt.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/conda_forge_tick/migrators/r_ucrt.py b/conda_forge_tick/migrators/r_ucrt.py index 1c71e3218..0435a8557 100644 --- a/conda_forge_tick/migrators/r_ucrt.py +++ b/conda_forge_tick/migrators/r_ucrt.py @@ -18,12 +18,11 @@ def _cleanup_raw_yaml(raw_yaml): line = line.replace("{{ posix }}pkg-config", "pkg-config") line = line.replace("- m2w64-pkg-config", "pkg-config") line = line.replace("- m2w64-toolchain", "- {{ compiler('m2w64_c') }}") + line = line.replace("- posix", "- m2-base") if "merge_build_host: " in line: continue if "- gcc-libs" in line: continue - if "- posix" in line: - line = line.replace("- posix", "- m2-base") if "set native =" in line: continue if re.search(r"\s*skip: (T|t)rue\s+\# \[win\]", line):