importStrategy: fromEnvironment
fallback doesn't work if the environment's Ruff is too old
#323
Labels
bug
Something isn't working
Hello! I've said it before, but thanks again for Ruff (and also for this excellent VS Code extension) 馃檪
I'm filing this just in case it isn't the intended behavior, although I can see a strong argument for it being fine. Please close with extreme prejudice if it's working as intended!
Actual Behavior
I noticed this behavior while trying to trying to use
ruff-vscode
across a few different repositories and virtual environments, both with and withoutruff
installed.With
importStrategy: fromEnvironment
:ruff-vscode
with an activated venv that does not haveruff
inside of it, the extension works as expected (falls back to its bundled copy ofruff
)ruff-vscode
with an activated venv that does haveruff
(but a too-oldruff
, like0.0.254
), the extension produces a warning telling me that the localruff
is too old:With that warning, no formatting is performed.
Expected Behavior
In this situation, I expected
ruff-vscode
to fall back on its bundled version after detecting that the virtual environment's version is too old. However, I can see an argument for this being too clever, especially given the workarounds below.Workarounds
The following workarounds work:
importStrategy: fromBundle
. This works as expected!ruff
, which I should have done a while ago.Other information
Host information (I believe this isn't a factor in this case, but for completeness):
The text was updated successfully, but these errors were encountered: