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 all commits
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 @@
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 migrate(
self, recipe_dir: str, attrs: "AttrsTypedDict", **kwargs: Any
) -> "MigrationUidTypedDict":
recipe_dir_path = Path(recipe_dir)

Check warning on line 207 in conda_forge_tick/migrators/arch.py

View check run for this annotation

Codecov / codecov/patch

conda_forge_tick/migrators/arch.py#L207

Added line #L207 was not covered by tests
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")

Check warning on line 212 in conda_forge_tick/migrators/arch.py

View check run for this annotation

Codecov / codecov/patch

conda_forge_tick/migrators/arch.py#L209-L212

Added lines #L209 - L212 were not covered by tests
else:
raise FileNotFoundError("No meta.yaml or recipe.yaml found")

Check warning on line 214 in conda_forge_tick/migrators/arch.py

View check run for this annotation

Codecov / codecov/patch

conda_forge_tick/migrators/arch.py#L214

Added line #L214 was not covered by tests

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 @@
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 migrate(
self, recipe_dir: str, attrs: "AttrsTypedDict", **kwargs: Any
) -> "MigrationUidTypedDict":
recipe_dir_path = Path(recipe_dir)

Check warning on line 388 in conda_forge_tick/migrators/arch.py

View check run for this annotation

Codecov / codecov/patch

conda_forge_tick/migrators/arch.py#L388

Added line #L388 was not covered by tests
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")

Check warning on line 393 in conda_forge_tick/migrators/arch.py

View check run for this annotation

Codecov / codecov/patch

conda_forge_tick/migrators/arch.py#L390-L393

Added lines #L390 - L393 were not covered by tests
else:
raise FileNotFoundError("No meta.yaml or recipe.yaml found")

Check warning on line 395 in conda_forge_tick/migrators/arch.py

View check run for this annotation

Codecov / codecov/patch

conda_forge_tick/migrators/arch.py#L395

Added line #L395 was not covered by tests

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