-
-
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
Disable pyright config? #9570
Disable pyright config? #9570
Conversation
I'd propose disabling pyright in the `pyproject.toml` file for now, since including it means that all errors show up in devs' vscode, which then makes it more difficult to work with the actual errors. It overrides local VS Code settings, so I don't think is possible to disable...
The pyright tests fail in CI. A few choices:
What do folks think? |
I didn't check the details, but maybe one can add these options as command line options in CI instead? |
How is the experience of Xarray contributors who use pyright as a LSP server but not from within vscode (pylance)? Mine is pretty bad. When running pyright version 1.1.349 on a recent commit in {
"useLibraryCodeForTypes": false,
"exclude": ["./doc", "./asv_bench", "./properties", "./.eggs", "./xarray/util/generate_*.py", "./build"],
"include": ["./xarray/**/*.py"],
"ignore": ["./xarray/core/pycompat.py"],
"reportMissingImports": "none",
"reportMissingTypeStubs": false,
"stubPath": "./xarray/core/",
"typeCheckingMode": "basic",
"strictParameterNoneValue": false,
"analyzeUnannotatedFunctions": true,
"reportGeneralTypeIssues": "information"
} I get Setting If I exclude tests I get I still use pyright as LSP server with emacs (+ native compilation and eglot) because it helps navigating / auto-completing the code, highlighting typing errors. I can hardly deal with the long list of diagnostics, though. And as soon as I have a few open buffers for large files like Am I configuring things wrong? Is there another LSP server that makes the overall experience much better (e.g., pylyzer, pylsp)? How does vscode (pylance) improves things? It would be a shame having to switch to vscode just for Xarray... Fixing all the pyright errors would be a huge task indeed. Disabling the tests (even locally) is not ideal since this is often where I catch typing issues or bugs before even running the tests. Ignoring pyright locally is not an option for me, unless there's another LSP server that provides a much better experience and that supports static type checking. |
Yes, in VS Code, pylance is extremely good at this, has made my life better! @benbovy on this branch, do you still get all the errors? In my VS Code I get zero errors. And for other VS-Coders, this is my config, super simple, zero errors reported on this branch. Notably changing "python.analysis.autoImportCompletions": true,
// "python.analysis.typeCheckingMode": "basic",
"python.analysis.diagnosticSeverityOverrides": {
// Xarray has try/expect-ed imports which we don't want to warn on; they're not
// even installable on aarch64.
"reportMissingImports": "information"
},
"python.analysis.exclude": ["build", ".trash", ".asv", ".venv", "target*"],
"python.languageServer": "Pylance",
No it wouldn't. (jk jk) Who is most likely to object to the change? I strongly don't want to me interfering in others' work, especially since I'm a much less prolific maintainer these days. Would only make this change if it makes it better for others (and using my own experience as an example of others'...) |
@max-sixty Yes I tried with the changes in this branch but I didn't notice any big difference. (I'm wondering what pylance has on top of pyright to bring down the number of errors from hundreds (thousands) to zero!) I don't have strong opinion about this PR... we can still customize the options locally in
Yes it would. 🙂 |
OK great!
😀 |
They're still useful unless we only care about the green color. You of course have to go and check the details and make sure you don't see anything unexpected. If you can move the options to the CI workflow that would be fine with me. When I added the CI I couldn't figure out how to do it, but I didn't investigate a lot nor do I use vscode so I didn't notice these issues. |
Actually, sorry, this doesn't change anything about pyright passing or not — it always fails, on main and this branch. I just opened #9578 as a test. Any objections to this being merged, then? |
Also cc @keewis who I think is not using vscode / pylance as well.
@Illviljan -- What are you using? (I'm genuinely curious about what developer tools (LSP) other Xarray developers are using, how they configure it and how their experience is better than mine). (We should probable better continue discussing that in #5238). |
Merging, hope that's OK, please feel free to revert if anyone has a strong view... |
I'd propose disabling pyright in the
pyproject.toml
file for now, since including it means that all errors show up in devs' vscode, which then makes it more difficult to work with the actual errors. It overrides local VS Code settings, so I don't think is possible to disable...