Open T-256 opened 1 month ago
IMO, then we can also drop ms-python.python
dependency since we don't need Python interpreter anymore.
At there we could use ms-python.python
as optional dep instead of mandatory dep.
I'm not sure if removing the ms-python.python
dependency is desired in the long term, or at least, not without implementing our own python selector.
I suspect that we'll soon need to call into Python from Ruff to discover the module search paths and possibly more. But we could make ms-python.python
an optional dependency.
Note that we have to call into Python if we want broad coverage for all system Pythons. Otherwise, there's no way to (completely) reliably get the path to the scripts directory.
I'm not sure if removing the
ms-python.python
dependency is desired in the long term, or at least, not without implementing our own python selector.I suspect that we'll soon need to call into Python from Ruff to discover the module search paths and possibly more. But we could make
ms-python.python
an optional dependency.
Exactly, in addition I think, at this point Ruff itself has well defined its config selector (based on Extension settings which then fallbacks to pyproject.toml/ruff.toml either on workspace dir or its parent dir). IIUC, in this extension, Python discovery is mainly used to pass target version of python to ruff. we could rely on project.required-python
or tool.ruff.target-version
instead.
Otherwise, there's no way to (completely) reliably get the path to the scripts directory.
IIUC, we use scripts directory to find if Ruff binary available locally into that. This is good. What I suggested is to drop ms-python.python
as hard dependency. which means if user already installed ms-python.python
we can still get scripts directory and when not installed, this extension will lookup on $PATH only.
IF we could convert this file into typescript, then extension wouldn't need Python installation/activation on target system at all. Currently Ruff extension needs python interpreter to start the server.
_Originally posted by @T-256 in https://github.com/astral-sh/ruff-vscode/pull/443#discussion_r1611696376_