-
-
Notifications
You must be signed in to change notification settings - Fork 186
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
Support skipping python_min
and pip_no_build_backend
hints
#2206
Conversation
Support `hint_python_min` in `linter.skip`. I went for a single token for all `python_min` hints, since it seems reasonable to assume that if one explicitly disables this, the feedstock was already inspected for appropriate `python_min` usage. Fixes conda-forge#2170
Support skipping the hints about missing build backend dependency, e.g. when the package itself is providing the build backend (e.g. in poetry-core-feedstock). Also requested in issue conda-forge#2170.
Fix the error such as: ``` Traceback (most recent call last): File "/home/mgorny/miniforge3/bin/conda-smithy", line 10, in <module> sys.exit(main()) ^^^^^^ File "/home/mgorny/git/conda-smithy/conda_smithy/cli.py", line 767, in main args.subcommand_func(args) File "/home/mgorny/git/conda-smithy/conda_smithy/cli.py", line 645, in __call__ lints, hints = linter.main( ^^^^^^^^^^^^ File "/home/mgorny/git/conda-smithy/conda_smithy/lint_recipe.py", line 733, in main results, hints = lintify_meta_yaml( ^^^^^^^^^^^^^^^^^^ File "/home/mgorny/git/conda-smithy/conda_smithy/lint_recipe.py", line 281, in lintify_meta_yaml if "lint_noarch_selectors" not in lints_to_skip: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: argument of type 'NoneType' is not iterable ``` when `conda-forge.yml` contains an empty key, e.g.: ``` linter: skip: ``` Noticed this accidentally while testing the other changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
I have just one point: I think test_hint_noarch_python_use_python_min
should become more similar in logic to test_hint_pip_no_build_backend
, as the testing in the former is currently not as good as in the latter.
tests/test_lint_recipe.py
Outdated
if not expected_hints: | ||
pytest.skip("No hints expected") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why should we need to skip this test if there are no expected hints? We could reformulate the test below to expect empty hints, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It always expected empty hints. I've skipped it because it's redundant, i.e. doesn't test anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I agree. It's still testing that the config in conda-forge.yml
doesn't break the case of "no hints expected".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense, I'll update it. In the end, the skips don't save that much time, and could be confusing.
Thanks! |
Checklist
news
entrypython conda_smithy/schema.py
)Fixes #2170
Add options to skip linter checks for
python_min
and missing build backend, both requested in #2170. While at it, fix aTypeError
that occurs whenconda-forge.yml
contains emptylinter:
orskip:
keys.