-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
--ignore-patterns
for .pyi
stubs has no effect if .py resolves to .pyi anyway
#9623
Comments
Pylint 3.2.0 reports an error in a .pyi file that 3.1.* didn't; we are ignoring pyi files since 3.0 since pylint doesn't handle them, but pylint is now ignoring the ignore. pylint-dev/pylint#9623 (See boost-histogram if you want see how many errors pylint can spew about pyi files! We just have one.) Signed-off-by: Henry Schreiner <[email protected]>
--ignore-patterns
doesn't ignore .pyi
stubs
The following appears to ignore the .pyi file as expected (not a list): [tool.pylint]
ignore-patterns = ".*\\.pyi" |
patterns plural should be a list, but changing it doesn't fix it. I still get the It seems to be specific, though, as in boost-histogram, if I update the pin to 3.2.*, it doesn't start picking up .pyi files (unless I delete the ignore-patterns line). FYI, it it's helpful, here are the
I think it found a few issues though,
|
I've looked over the diff v3.1.1...v3.2.0, and I really don't see what could have changed. |
If I checkout the repo and run pylint as-is without changing the pyproject.toml in the project at all it already works (not sure why!): (venv312) markbyrne@Marks-Air-2 src % pylint scikit_build_core/_version.pyi
(venv312) markbyrne@Marks-Air-2 src % As an example, the following shows the syntax in action: (venv312) markbyrne@Marks-Air-2 src % pylint scikit_build_core/_version.pyi --ignore-patterns=".*\.pyix"
************* Module scikit_build_core._version
scikit_build_core/_version.pyi:2:15: E1131: unsupported operand type(s) for | (unsupported-binary-operation)
------------------------------------------------------------------
Your code has been rated at 0.00/10 (previous run: 0.00/10, +0.00)
(venv312) markbyrne@Marks-Air-2 src % pylint scikit_build_core/_version.pyi --ignore-patterns=".*\.pyi"
(venv312) markbyrne@Marks-Air-2 src % (venv312) markbyrne@Marks-Air-2 src % pylint --version
pylint 3.2.0
astroid 3.2.0
Python 3.12.0 |
@mbyrnepr2 thanks for jumping on triage. I'm assuming it's the get_source_file() change we did in astroid. Did you test with a same named .py file next to the .pyi? |
The file is at I've noticed I sometimes see two identical errors if I remove the exclusion. $ sed -i '' /ignore-patterns/d pyproject.toml
$ nox -s pylint
nox > Running session pylint
nox > Re-using existing virtual environment at .nox/pylint.
nox > uv pip install '-e.[dev,test,test-meta]' 'pylint==3.2.*'
nox > pylint --version
pylint 3.2.0
astroid 3.2.0
Python 3.12.3 (main, Apr 9 2024, 08:09:14) [Clang 15.0.0 (clang-1500.3.9.4)]
nox > pylint scikit_build_core
************* Module scikit_build_core._version
src/scikit_build_core/_version.pyi:2:15: E1131: unsupported operand type(s) for | (unsupported-binary-operation)
src/scikit_build_core/_version.pyi:2:15: E1131: unsupported operand type(s) for | (unsupported-binary-operation)
------------------------------------------------------------------
Your code has been rated at 9.97/10 (previous run: 9.51/10, +0.46)
nox > Command pylint scikit_build_core failed with exit code 2
nox > Session pylint failed. |
Ahh, if you just run without installing, you don't have a matching |
Thanks @henryiii. I think we should consider hotfixing a reversion of pylint-dev/astroid#2375 in astroid. It's not really ready for primetime. |
--ignore-patterns
doesn't ignore .pyi
stubs--ignore-patterns
for .pyi
stubs has no effect if .py resolves to .pyi anyway
Right indeed I can reproduce it after installing first! |
(FYI, if using scikit-build-core for testing, I'll be manually adding an ignore on this line for now, since I really want pylint 3.2's GHA reporter! :D ) |
I agree a revert is in order. |
Bug description
tool.pylint.ignore-patterns
stopped working in pylint 3.2.0. Pylint can't handle.pyi
files yet, it just treats them like.py
, which causes it to report that|
is invalid, etc.Configuration
Command used
(technically
nox -s pylint
in https://github.com/scikit-build/scikit-build-core)Pylint output
Expected behavior
It should skip the ignored files. It does if I pin 3.1.*.
Pylint version
OS / Environment
macOS.
Additional dependencies
No response
The text was updated successfully, but these errors were encountered: