Skip to content

Commit

Permalink
fix: report not the regex
Browse files Browse the repository at this point in the history
  • Loading branch information
beckermr committed Nov 21, 2024
1 parent d00c6b6 commit d1a6d60
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions conda_smithy/linter/hints.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,15 +246,33 @@ def hint_noarch_python_use_python_min(
):
if noarch_value == "python" and not outputs_section:
hint = ""
for section_name, syntax, reqs in [
("host", r"python\s+\{\{ python_min \}\}", host_reqs),
("run", r"python\s+>=\{\{ python_min \}\}", run_reqs),
("test.requires", r"python\s+\{\{ python_min \}\}", test_reqs),
for section_name, syntax, report_syntax, reqs in [
(
"host",
r"python\s+{{ python_min }}",
"python {{ python_min }}",
host_reqs,
),
(
"run",
r"python\s+>={{ python_min }}",
"python >={{ python_min }}",
run_reqs,
),
(
"test.requires",
r"python\s+{{ python_min }}",
"python {{ python_min }}",
test_reqs,
),
]:
if recipe_version == 1:
syntax = syntax.replace(
"{{ python_min }}", "${{ python_min }}"
)
report_syntax = report_syntax.replace(
"{{ python_min }}", "${{ python_min }}"
)
test_syntax = syntax
else:
test_syntax = syntax.replace("{{ python_min }}", "9999")
Expand All @@ -268,7 +286,7 @@ def hint_noarch_python_use_python_min(
break
else:
hint += (
f"\n - For the `{section_name}` section of the recipe, you should usually use `{syntax}` "
f"\n - For the `{section_name}` section of the recipe, you should usually use `{report_syntax}` "
f"for the `python` entry."
)

Expand Down

0 comments on commit d1a6d60

Please sign in to comment.