Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions conda_smithy/lint_recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,14 @@ def lintify(meta, recipe_dir=None):
except RuntimeError as e:
lints.append(str(e))

# 13: If cython/numpy is a build-dependency then python should be a run-time
# dependency. This ensures that packages will be marked correctly by conda
build_deps = ['cython', 'numpy x.x']
need_python_run_time = any([dep in requirements_section.get('build', '') for dep in build_deps])
if need_python_run_time and 'python' not in requirements_section.get('run', ''):
lints.append("Found python related compilation requirement "
"please add python as a run-time dependency")

return lints


Expand Down
9 changes: 9 additions & 0 deletions conda_smithy/tests/test_lint_recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,15 @@ def test_end_empty_line(self):
else:
self.assertIn(expected_message, lints)

def test_implicit_python_run_time_dependency(self):
build_deps = ['cython', 'numpy x.x']
expected_message = ("Found python related compilation requirement "
"please add python as a run-time dependency")
for dep in build_deps:
meta = {'requirements': {'build': [dep, 'python']}}
lints = linter.lintify(meta)
self.assertIn(expected_message, lints)


class TestCLI_recipe_lint(unittest.TestCase):
def test_cli_fail(self):
Expand Down