diff --git a/grayskull/strategy/pypi.py b/grayskull/strategy/pypi.py index f74d2328..532362d4 100644 --- a/grayskull/strategy/pypi.py +++ b/grayskull/strategy/pypi.py @@ -590,9 +590,9 @@ def set_python_min(req_list: list, section: str) -> list: return req_list python_min = "<{ python_min }}" map_section = { - "test": f"={python_min}", "host": f"{python_min}.*", "run": f">={python_min}", + "test": f"={python_min}", } return [ f"python {map_section[section]}" if dep.lower().strip() == "python" else dep diff --git a/tests/test_pypi.py b/tests/test_pypi.py index a5b68f6a..b3b4b799 100644 --- a/tests/test_pypi.py +++ b/tests/test_pypi.py @@ -45,6 +45,7 @@ normalize_requirements_list, remove_all_inner_nones, remove_selectors_pkgs_if_needed, + set_python_min, sort_reqs, update_recipe, ) @@ -1453,3 +1454,16 @@ def test_check_noarch_python_for_new_deps(): config, ) assert config.is_arch is False + + +@pytest.mark.parametrize( + "section, expected", + [ + ("host", "python <{ python_min }}.*"), + ("run", "python >=<{ python_min }}"), + ("test", "python =<{ python_min }}"), + ], +) +def test_set_python_min(section, expected): + req = ["pip", "python"] + assert set_python_min(req, section) == ["pip", expected]