Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enable arch migrators for v1 recipes #3019

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions conda_forge_tick/migrators/arch.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import typing
from pathlib import Path
from textwrap import dedent
from typing import Any, Optional, Sequence

Expand Down Expand Up @@ -91,6 +92,7 @@ class ArchRebuild(GraphMigrator):
rerender = True
# We purposefully don't want to bump build number for this migrator
bump_number = 0
allowed_schema_versions = [0, 1]
ignored_packages = {
"make",
"perl",
Expand Down Expand Up @@ -202,8 +204,15 @@ def filter(self, attrs: "AttrsTypedDict", not_bad_str_start: str = "") -> bool:
def migrate(
self, recipe_dir: str, attrs: "AttrsTypedDict", **kwargs: Any
) -> "MigrationUidTypedDict":
recipe_dir_path = Path(recipe_dir)
with pushd(recipe_dir + "/.."):
self.set_build_number("recipe/meta.yaml")
if (recipe_dir_path / "recipe/meta.yaml").exists():
self.set_build_number("recipe/meta.yaml")
elif (recipe_dir_path / "recipe/recipe.yaml").exists():
self.set_build_number("recipe/recipe.yaml")
else:
raise FileNotFoundError("No meta.yaml or recipe.yaml found")

with open("conda-forge.yml") as f:
y = yaml_safe_load(f)
if "provider" not in y:
Expand Down Expand Up @@ -247,6 +256,7 @@ class OSXArm(GraphMigrator):
rerender = True
# We purposefully don't want to bump build number for this migrator
bump_number = 0
allowed_schema_versions = [0, 1]

ignored_packages = set()
excluded_dependencies = set()
Expand Down Expand Up @@ -375,8 +385,15 @@ def filter(self, attrs: "AttrsTypedDict", not_bad_str_start: str = "") -> bool:
def migrate(
self, recipe_dir: str, attrs: "AttrsTypedDict", **kwargs: Any
) -> "MigrationUidTypedDict":
recipe_dir_path = Path(recipe_dir)
with pushd(recipe_dir + "/.."):
self.set_build_number("recipe/meta.yaml")
if (recipe_dir_path / "recipe/meta.yaml").exists():
self.set_build_number("recipe/meta.yaml")
elif (recipe_dir_path / "recipe/recipe.yaml").exists():
self.set_build_number("recipe/recipe.yaml")
else:
raise FileNotFoundError("No meta.yaml or recipe.yaml found")

with open("conda-forge.yml") as f:
y = yaml_safe_load(f)
# we should do this recursively but the cf yaml is usually
Expand Down