exclude does not work for jupyter notebooks
Description
Specifically excluding a notebook with exclude will still result in the notebook being analyzed.
Sample config:
"exclude": [
"tmp*/**",
"data/**",
"**/node_modules",
"**/__pycache__",
"**/.*",
"test.ipynb"
]
Interestingly, even if I specify an include and target a subdirectory, it still gets the notebook from the root directory.
use ignore instead. i want to merge these two options into one because the current behavior is quite confusing. see #31
closing in favor of #31
@DetachHead even using the exclude and ignore, I still see it analyzing ipynb files. Even if I specify the exact filename without wildcards, I still see it analyzing in the log traces.
I wonder if it has something to do with processing each cell individually?
i can't reproduce. could you provide some more info please:
- does it happen in the language server, CLI or both?
- if it happens in the language server, what editor are you using?
- does
ignorework for you with regular.pyfiles? - what version of basedpyright are you using?
Hi, I have the same issue with the language server with:
[tool.pyright]
ignore = ["*.ipynb"]
"basedpyright.analysis.ignore": [
"*.ipynb",
"*.py"
]
Using:
Identifier: detachhead.basedpyright
Version: 1.29.5
With ignore = ["*.ipynb", "*.py"] I still get basedpyright reports in the IDE on regular .py files.
Ok, so Cursor still uses VScode: 1.99.3. Last compatible basedpyright for this VSCode version is 1.29.5. I guess that doesn't help.
that's probably a different issue. can you provide the full error message?
Sure:
File length of "file:///....ipynb" is 61290525 which exceeds the maximum supported file size of 52428800
Source: BasedPyright
that's definitely unrelated, the max file size supported by pyright is 50mb https://github.com/DetachHead/basedpyright/blob/cfc20e6b25e46affa67b35eae5eaab21b4e2b533/packages/pyright-internal/src/analyzer/sourceFile.ts#L61-L63
if you believe this limit should be increased you can open a separate issue to discuss it, but i highly recommend splitting that notebook up into separate files instead.
closing this for now as i still don't have enough info to reproduce the original issue so i'm assuming it's the same issue as #31. if anybody can help me reproduce this by providing the info i requested above i'll be happy to reopen
@RobinFrcd if your issue is "I tried to ignore a file, but it still reported as too big", can you please report this as a separate issue, as it sounds like an unrelated issue to this issue
Regardless of the size of the file, if I want to ignore all .ipynb BasedPyright should just skip them, no ?
oh sorry i misunderstood what you were asking. so the issue in #31 is that the exclude setting is ignored by the language server, while ignore works. but all ignore does is filter out any diagnostics reported for that file. this means that any ignored files still need to be parsed for other language server features to work, which is why you're still seeing that error.