Repository navigation
ci(lint): add a lint job and fix the two open ruff findings on main - #145
Open
ddaihao2022 wants to merge 1 commit into
Open
ddaihao2022 wants to merge 1 commit into
ddaihao2022 wants to merge 1 commit into
Conversation
Closes LLMSQL#103 - llmsql/_cli/llmsql_cli.py: sort the two llmsql._cli imports (I001) and separate the class from them with two blank lines - llmsql/inference/inference_api.py: zip(questions, prompts) silently dropped the tail whenever the two lists had different lengths; pass strict=True (B905) - llmsql/_cli/inference.py: ruff format (the only change is wrapping one parser.add_argument call) - .github/workflows/tests.yml: new lint job running ruff check and ruff format --check on 3.10-3.13, pinned to ruff 0.8.4, the revision in .pre-commit-config.yaml. The matrix matters because the lint rules include UP (pyupgrade), whose findings depend on the target Python version. - .github/workflows/docs.yml: actions/setup-python v4 -> v5
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #103
What changes
CI only ran pytest, so
ruff check llmsqlhad been failing onmainunnoticed. This fixes the two open findings and adds alintjob so it stays fixed.llmsql/_cli/llmsql_cli.py— I001: the twollmsql._cliimports were unsorted, and the class body started one blank line too early.llmsql/inference/inference_api.py— B905:zip(questions, prompts)silently dropped the tail of whichever list was longer.strict=Trueturns that into an error instead of generating fewer completions than there are questions.llmsql/_cli/inference.py— onlyruff format(oneparser.add_argumentcall wrapped)..github/workflows/tests.yml— newlintjob:ruff check llmsqlandruff format --check llmsql..github/workflows/docs.yml—actions/setup-python@v4→v5.Notes on the job
0.8.4, the revision in.pre-commit-config.yaml, so CI and the pre-commit hook agree.requires-python = ">=3.10"). This matters: the lint rules includeUP(pyupgrade), whose findings depend on[tool.ruff] target-version/ the interpreter, so a single version would not catch e.g. aUPfix that is only valid on 3.12+.mypy llmsqlis deliberately not in the job yet.mypy --ignore-missing-imports --check-untyped-defsreports pre-existing findings across the package that have nothing to do with this change, so enabling it here would turn the new required job red on the first run. I'd rather do that as its own pass (fix the findings, then add the command) — say the word if you want it in this PR instead.How it was tested
The 5 failures are pre-existing on this machine and unrelated:
ModuleNotFoundError: No module named 'transformers'(5 files undertests/inferencethat import it cannot even be collected withouttransformers, which cannot be installed here).tests/cligives the identical 5 failures with and without this change.Not run here: the full
pdm install --with dev,vllmsuite (needs GPU/vLLM).Checklist
ruff check llmsqlandruff format --check llmsqlpass.