-
Notifications
You must be signed in to change notification settings - Fork 25
Closed
Description
As part of adding support for ruff on Spyder, I stumbled with a couple of issues on Windows (spyder-ide/spyder#24970). Seems like on Windows a cmd
is shown everytime a run_ruff
call is done. Checking, seems like doing the following changes prevent any cmd
appereance on Windows:
- Pass the
CREATE_NO_WINDOW
flag in thePopen
call. So changing:
python-lsp-ruff/pylsp_ruff/plugin.py
Line 560 in a0a33a6
p = Popen(cmd, stdin=PIPE, stdout=PIPE) |
To be something like (including adding the new import for CREATE_NO_WINDOW
)
p = Popen(cmd, stdin=PIPE, stdout=PIPE, creationflags=CREATE_NO_WINDOW)
- Ensure
python.exe
usage (instead of for examplepythonw.exe
) when running ruff as a module. So changing:
python-lsp-ruff/pylsp_ruff/plugin.py
Line 505 in a0a33a6
cmd = [sys.executable, "-m", "ruff"] |
To be
cmd = [sys.executable.replace("pythonw", "python"), "-m", "ruff"]
Let me know if the above makes sense and I will submit a PR with the changes
Metadata
Metadata
Assignees
Labels
No labels