This would help in the situation where the IDE does not start the LSP with the Virtual Environment activated and where the virtual environment path is not fixed. See #1655
[tool.pyrefly]
# poetry interpreter path is different for all users, use info command instead
# python-interpreter-path=""C:\Users\user\AppData\Local\pypoetry\Cache\virtualenvs\test-pyrefly-lsp-Pe66xNAj-py3.13\Scripts\python.exe""
python-interpreter-find-cmd = ["poetry", "env", "info", "-e"]
Alternatively, just specifying the tool that supports a run sub command could make this generic
[tool.pyrefly]
venv_manager = "poetry | hatch | uv | pipenv"
interpreter = run([venv_manager, "run", "python", "-c", "import sys;print(sys.executable)"])
This would help in the situation where the IDE does not start the LSP with the Virtual Environment activated and where the virtual environment path is not fixed. See #1655
Alternatively, just specifying the tool that supports a
runsub command could make this genericinterpreter = run([venv_manager, "run", "python", "-c", "import sys;print(sys.executable)"])