mirror of
https://github.com/astral-sh/ruff.git
synced 2026-11-21 12:16:15 +08:00
## Summary This PR is a first step towards updating the project's uv metadata when the virtual environment changes. The scope of this PR is to add the non-uv specific virtual environment file watching. That is, it adds the necessary file watching handling to update the detected virtual environment and its Python version when: * a `pyenv.cfg` changes * the default `.venv` or the explicitly specified `environment.python` virtual environment gets created or deleted. Unfortunately, this does require storing the path to the resolved virtual environment in `ProgramSettings`. Otherwise, we'd have to resolve it every time we see a related file watcher event. It's unfortunate because it doesn't feel like a setting. But there isn't really any better to carry forward this information. I recommend reviewing this PR commit by commit. ## Test Plan Native file-watching regression tests pass.