Skip to content

Commit

Permalink
Merge pull request #30 from minrk/constrains
Browse files Browse the repository at this point in the history
handle constraints from run_exports
  • Loading branch information
beckermr authored May 7, 2024
2 parents 0fbfb88 + 4b87f9a commit 10099c2
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 9 deletions.
24 changes: 15 additions & 9 deletions conda_forge_feedstock_check_solvable/mamba_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import time
import traceback
from collections import defaultdict
from collections.abc import Mapping
from dataclasses import dataclass, field
from typing import Dict, FrozenSet, Iterable, List, Set, Tuple

Expand Down Expand Up @@ -53,6 +54,8 @@
"weak": set(),
"strong": set(),
"noarch": set(),
"strong_constrains": set(),
"weak_constrains": set(),
}

MAX_GLIBC_MINOR = 50
Expand Down Expand Up @@ -421,25 +424,28 @@ def _get_run_export(link_tuple):
if isinstance(rx, str):
# some packages have a single string
# eg pyqt
rx = [rx]
rx = {"weak": [rx]}

for k in rx:
if not isinstance(rx, Mapping):
# list is equivalent to weak
rx = {"weak": rx}

for k, spec_list in rx.items():
if k in DEFAULT_RUN_EXPORTS:
print_debug(
"RUN EXPORT: %s %s %s",
name,
k,
rx[k],
spec_list,
)
run_exports[k].update(rx[k])
run_exports[k].update(spec_list)
else:
print_debug(
"RUN EXPORT: %s %s %s",
print_warning(
"RUN EXPORT: unrecognized run_export key in %s: %s=%s",
name,
"weak",
[k],
k,
spec_list,
)
run_exports["weak"].add(k)

return run_exports

Expand Down
24 changes: 24 additions & 0 deletions tests/test_mamba_solvable.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,30 @@ def test_cupy_solvable(tmp_path):
assert solvable, pprint.pformat(errors)


@flaky
def test_run_exports_strong_constrains_solvable(tmp_path):
"""dolfinx_mpc depends on fenics-basix which has strong_constrained in run_exports"""
feedstock_dir = clone_and_checkout_repo(
tmp_path,
"https://github.com/conda-forge/dolfinx_mpc-feedstock",
ref="main",
)
subprocess.run(
"git checkout 26bb83149573c285cd596fbca2db89a4c69435c3",
cwd=feedstock_dir,
shell=True,
check=True,
)
# keep only one variant, avoid unnecessary solves
# every variant exercises this issue and this feedstock has ~100 variants
for cbc in pathlib.Path(feedstock_dir).glob(".ci_support/*.yaml"):
if cbc.name != "linux_64_mpimpichpython3.10.____cpythonscalarreal.yaml":
cbc.unlink()
solvable, errors, solvable_by_variant = is_recipe_solvable(feedstock_dir)
pprint.pprint(solvable_by_variant)
assert solvable, pprint.pformat(errors)


@flaky
def test_is_recipe_solvable_notok(feedstock_dir):
recipe_file = os.path.join(feedstock_dir, "recipe", "meta.yaml")
Expand Down

0 comments on commit 10099c2

Please sign in to comment.