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

allow operators in noarch selector lint #1735

Merged
merged 3 commits into from
Aug 24, 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
9 changes: 7 additions & 2 deletions conda_smithy/lint_recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -941,8 +941,13 @@ def is_selector_line(line, allow_platforms=False):
return False
m = sel_pat.match(line)
if m:
if allow_platforms and m.group(3) in ["win", "linux", "osx", "unix"]:
return False
if allow_platforms:
nouns = {
w for w in m.group(3).split() if w not in ("not", "and", "or")
}
if nouns.issubset({"win", "linux", "osx", "unix"}):
# the selector only contains (a boolean chain of) platform selectors
return False
else:
return True
return False
Expand Down
23 changes: 23 additions & 0 deletions news/noarch-platforms-lint-selectors-operators.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* <news item>

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* Allow operators in noarch platform selectors

**Security:**

* <news item>
2 changes: 1 addition & 1 deletion tests/recipes/noarch_platforms/recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ requirements:
- tomli >=1.0.0
- colorama # [win]
- __win # [win]
- __unix # [unix]
- __unix # [not win]

run_constrained:
# pytest-faulthandler 2 is a dummy package.
Expand Down