Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Version constraints can start with ! as well #919

Merged
merged 2 commits into from
Sep 28, 2023
Merged
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
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
Loading