diff --git a/grayskull/strategy/py_base.py b/grayskull/strategy/py_base.py index bb48f94e8..e00ec485e 100644 --- a/grayskull/strategy/py_base.py +++ b/grayskull/strategy/py_base.py @@ -531,9 +531,19 @@ def is_compiler_present() -> bool: if not is_compiler_present(): return + + def clean_list_pkg(pkg, list_pkgs): + result = [] + for p in list_pkgs: + if pkg == p.strip().split(" ", 1)[0]: + continue + result.append(p) + return result + for pkg in requirements["host"]: pkg_name = RE_DEPS_NAME.match(pkg).group(0) if pkg_name in PIN_PKG_COMPILER.keys(): + requirements["run"] = clean_list_pkg(pkg_name, requirements["run"]) if pkg_name in requirements["run"]: requirements["run"].remove(pkg_name) requirements["run"].append(PIN_PKG_COMPILER[pkg_name]) diff --git a/tests/test_pypi.py b/tests/test_pypi.py index df0ae36d1..548c6fa00 100644 --- a/tests/test_pypi.py +++ b/tests/test_pypi.py @@ -875,3 +875,9 @@ def test_create_recipe_from_local_sdist(pkg_pytest): def test_400_for_python_selector(): recipe = create_python_recipe("pyquil", version="3.0.1")[0] assert recipe["build"]["skip"].selector == "py>=400 or py2k" + + +def test_numpy_and_pin_compatible_mixed(): + recipe = create_python_recipe("dimod", version="0.10.13")[0] + assert "<{ pin_compatible('numpy') }}" in list(recipe["requirements"]["run"]) + assert "numpy" not in list(recipe["requirements"]["run"])