diff --git a/bioconda_utils/lint/check_syntax.py b/bioconda_utils/lint/check_syntax.py index ea6f76ab2f..7336b92840 100644 --- a/bioconda_utils/lint/check_syntax.py +++ b/bioconda_utils/lint/check_syntax.py @@ -23,7 +23,7 @@ def check_recipe(self, recipe): for section in ('build', 'run', 'host'): check_paths.append(f'requirements/{section}') - constraints = re.compile("(.*?)([<=>].*)") + constraints = re.compile("(.*?)([!<=>].*)") for path in check_paths: for n, spec in enumerate(recipe.get(path, [])): has_constraints = constraints.search(spec) @@ -37,7 +37,7 @@ def fix(self, _message, _data): for section in ('build', 'run', 'host'): check_paths.append(f'requirements/{section}') - constraints = re.compile("(.*?)([<=>].*)") + constraints = re.compile("(.*?)([!<=>].*)") for path in check_paths: for spec in self.recipe.get(path, []): has_constraints = constraints.search(spec) diff --git a/test/lint_cases.yaml b/test/lint_cases.yaml index a9d882a509..6848a223fa 100644 --- a/test/lint_cases.yaml +++ b/test/lint_cases.yaml @@ -303,7 +303,7 @@ tests: build.sh: | $PYTHON setup.py install - name: version_constraints_whitespace_ok - add: { requirements: { run: ["one >1", "two >=1", "three >1,<2"] } } + add: { requirements: { run: ["one >1", "two >=1", "three >1,<2", "four !=3.3"] } } - name: version_constraints_whitespace_missing expect: version_constraints_missing_whitespace add: { requirements: { run: ["one>1"] } }