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

Allow migrating compilers using include_build #2995

Merged
merged 2 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ __migrator:
# The bot will skip noarch feedstocks by default.
include_noarch: false

# If `include_build` is set to true, the bot will include build requirements in the migration.
# The bot will skip build requirements by default, which prevents compiler migrations.
include_build: false

# The pr_limit controls how many PRs that bot makes in a single run.
# Typical values range from 5 (small/slow) to 30 (large/fast). If not given,
# the bot will scale this limit automatically to make new migrations more responsive
Expand Down
1 change: 1 addition & 0 deletions conda_forge_tick/make_migrators.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ def add_rebuild_migration_yaml(
excluded_feedstocks,
exclude_pinned_pkgs=exclude_pinned_pkgs,
include_noarch=config.get("include_noarch", False),
include_build=config.get("include_build", False),
)

# Note at this point the graph is made of all packages that have a
Expand Down
8 changes: 6 additions & 2 deletions conda_forge_tick/migrators/migration_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,7 @@
excluded_feedstocks: MutableSet[str] = None,
exclude_pinned_pkgs: bool = True,
include_noarch: bool = False,
include_build: bool = False,
) -> nx.DiGraph:
total_graph = copy.deepcopy(gx)
excluded_feedstocks = set() if excluded_feedstocks is None else excluded_feedstocks
Expand All @@ -677,7 +678,10 @@
requirements = attrs.get("requirements", {})
host = requirements.get("host", set())
build = requirements.get("build", set())
bh = host or build
if include_build:
bh = host | build

Check warning on line 682 in conda_forge_tick/migrators/migration_yaml.py

View check run for this annotation

Codecov / codecov/patch

conda_forge_tick/migrators/migration_yaml.py#L681-L682

Added lines #L681 - L682 were not covered by tests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think build_host_requirements or similar is a more descriptive variable name than bh.

else:
bh = host or build

Check warning on line 684 in conda_forge_tick/migrators/migration_yaml.py

View check run for this annotation

Codecov / codecov/patch

conda_forge_tick/migrators/migration_yaml.py#L684

Added line #L684 was not covered by tests
only_python = "python" in package_names
inclusion_criteria = bh & set(package_names) and (
include_noarch or not all_noarch(attrs, only_python=only_python)
Expand All @@ -687,7 +691,7 @@
all_reqs = requirements.get("run", set())
if inclusion_criteria:
all_reqs = all_reqs | requirements.get("test", set())
all_reqs = all_reqs | (host or build)
all_reqs = all_reqs | bh

Check warning on line 694 in conda_forge_tick/migrators/migration_yaml.py

View check run for this annotation

Codecov / codecov/patch

conda_forge_tick/migrators/migration_yaml.py#L694

Added line #L694 was not covered by tests
rq = get_deps_from_outputs_lut(
all_reqs,
gx.graph["outputs_lut"],
Expand Down