Skip to content

Commit

Permalink
fix: Version constraints can start with ! as well (#919)
Browse files Browse the repository at this point in the history
Resolves #918
  • Loading branch information
corneliusroemer authored Sep 28, 2023
1 parent c7efb92 commit ee56f6e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bioconda_utils/lint/check_syntax.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion test/lint_cases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] } }
Expand Down

0 comments on commit ee56f6e

Please sign in to comment.