python-lsp / python-lsp-ruff

Linter plugin for pylsp based on ruff.
MIT License
162 stars 22 forks source link

Does this plugin install ruff? #100

Open kaddkaka opened 2 hours ago

kaddkaka commented 2 hours ago

Does this plugin install ruff and is there any way to avoid that?

I already have ruff installed and available from my nix-shell environment. The version of ruff is tied to the project which might update slowly, currently the ruff version used 0.5.0.

I installed python-lsp-server with pipx and then installed the mypy and ruff plugins like this:

pipx install python-lsp-server
cd ~/.local/share/pipx/venvs/python-lsp-server
source base/activate
python3 -m pip install pylsp-mypy
python3 -m pip install python-lsp-ruff

however the issue is that this causes ruff 0.7.0 to be installed and picked up. (it seems like)

Is there some way to just get the connection to ruff enable (without installing ruff), and then use the ruff binary that will be loaded by my nix-shell environment (0.5.0)?

kaddkaka commented 2 hours ago

is it because of the dependency in the pyproject.toml file and is that really necessary?

I tried to just renamed the ruff binary in my python-lsp-server virtualenv, but instead now I get 0 diagnostics from ruff.

So is it possible that pylsp can find "external" ruff (via PATH) instead?