InSyncWithFoo / pyright-for-pycharm

Pyright integration for PyCharm
https://insyncwithfoo.github.io/pyright-for-pycharm/
MIT License
58 stars 3 forks source link

Does not resolve `pyproject.toml` (using WSL2) #93

Open TimChild opened 3 days ago

TimChild commented 3 days ago

What happened?

Pyright runs, doesn't produce any obvious errors (is there a log somewhere that I can check for more details?) but doesn't seem to be using the pyproject.toml settings that are picked up when running pyright from wsl2 terminal directly.

I went down a whole rabbit whole thinking it was just a filename conversion issue related to wsl2, but I'm not sure now... @InSyncWithFoo I'm hoping that you'll just be able to spot obvious to you given your recent work here where you "overcame a nightmare".

Steps to reproduce

Repository and poetry env live in WSL2, pycharm is being run from windows. Pyright is installed in poetry env.

First thing I noticed was that packages installed in the poetry env weren't being recognized, but further testing revealed that the whole pyproject.toml settings are being ignored (i.e. setting reportXXX = false in [tool.pyright] has no effect on warnings shown.

Setup and things I tried: image Also tried setting the configuration file to the pyroject.toml or a pyrightconfig.json file but whatever I selected wouldn't save (maybe that is actually a bug?). I don't think it should be necessary though since the pyproject.toml should have been detected automatically by pyright (as it was when running from wsl terminal).

In pyproject.toml image I don't think the language server part does anything with Command line mode selected (right?).

Things I also tried:

Tried these things before I realised the pyproject.toml was not being used at all...

All in vain...

Seems like the Native LSP client mode could work given than the first command tried to run from zsh, if only I could point that to the pyright in wsl instead of the windows path, but I couldn't figure out where to configure that.

Or is there a better solution I am missing altogether?

System: Win 11 PyCharm 2024.3 (Professional Edition) Build #PY-243.21565.199, built on November 12, 2024 pyright 1.1.389 (both in windows and poetry env)

Sorry to bring up PyCharm/WSL nightmare stuff again!

Relevant log output or stack trace

Where can I find these?

Operating system

Windows

gerhardadler commented 2 days ago

I think I'm facing the same issue on a computer running native Linux (openSUSE Tumbleweed). I cannot save the configuration file. (pyproject.toml) image

InSyncWithFoo commented 2 days ago

I'll look into this by the end of this week.

Thank you both for reporting the problems. It is really nice to know that something I maintain have such dedicated users. So nice, in fact, that the debugging nightmares don't seem too bad after all.

TimChild commented 2 days ago

@InSyncWithFoo -- Honestly, your plugin is the last hope Intellij has of keeping me as a user of pycharm at all. Their built in type checking/inference is hopeless. It's frustrating that they don't make you're life as a plugin maintainer a little easier too!