`py-search` to help implement [[launch]] # Struts ## Python version - Unknown - Major - MajorMinor - MajorMinorMicro - Pre-release support? Only useful if you have full version info (`build-details.json`, registry?) ## Search results - Path to interpreter - Known version - Free-threaded - Debug - `w` variant on Windows - Method used to find it # Iterators ## `$VIRTUAL_ENV` - All env vars? - `Option` from accessing env vars? - OsString of env var? - Return - `Result<Iter>` which requires checking upfront that there's a value? - `Iter<Result>` which requires all iterators to return `Result` even if it doesn't make sense? ## `.venv` - Path? - path and search parents? - Return - `Result<Iter>`? - `Iter<Result>`? ## `$PATH` - All env vars? - `Option` from accessing env vars? - OsString of env var? - Single directory? ## Registry Covers [pymanager](https://github.com/python/pymanager) installs (although `pymanager list` also includes [PEP 514](https://peps.python.org/pep-0514/) installs). Data is: ![[Pasted image 20261110132801.png]] ## Microsoft Store installs > Searching in %LocalAppData%\WindowsApps for the Python folders is the safest way, they don't move. https://github.com/python/cpython/blob/05d6a94b92ff9098e8947064499f7a1a09b04770/PC/launcher2.c#L1977-L2001 (3.14 only had alphas on the MS Store)