diff --git a/.gitignore b/.gitignore index 0e1abb2d0b..b0d4b9df31 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ *~ *.pyc *.egg-info +*.swp build/ dist/ docs/_build diff --git a/conda_build/render.py b/conda_build/render.py index b0c3237d4e..3df2a84114 100644 --- a/conda_build/render.py +++ b/conda_build/render.py @@ -415,7 +415,7 @@ def get_upstream_pins(m: MetaData, precs, env): ignore_list = utils.ensure_list(m.get_value("build/ignore_run_exports")) additional_specs = {} for prec in precs: - if any(prec.name in req.split(" ")[0] for req in ignore_pkgs_list): + if any((prec.name == req.split(" ")[0]) for req in ignore_pkgs_list): continue run_exports = None if m.config.use_channeldata: diff --git a/tests/test-recipes/metadata/ignore_run_exports_from_substr/meta.yaml b/tests/test-recipes/metadata/ignore_run_exports_from_substr/meta.yaml new file mode 100644 index 0000000000..067afc6a2e --- /dev/null +++ b/tests/test-recipes/metadata/ignore_run_exports_from_substr/meta.yaml @@ -0,0 +1,14 @@ +package: + name: pkg + version: 1.0.0 + +build: + number: 0 + ignore_run_exports_from: + - i-like-python + +requirements: + host: + - conda-forge::python + run: + - numpy diff --git a/tests/test_api_build.py b/tests/test_api_build.py index 83ef4abc9b..9b2f67de8a 100644 --- a/tests/test_api_build.py +++ b/tests/test_api_build.py @@ -2122,6 +2122,13 @@ def test_api_build_inject_jinja2_vars_on_first_pass(testing_config): api.build(recipe_dir, config=testing_config) +def test_ignore_run_exports_from_substr(tmp_path, capsys): + with tmp_path: + api.build(str(metadata_path / "ignore_run_exports_from_substr")) + + assert "- python_abi " in capsys.readouterr().out + + @pytest.mark.skipif(not on_linux, reason="One platform is enough") def test_build_strings_glob_match(testing_config: Config) -> None: """