justinmayer / virtualfish

Fish shell tool for managing Python virtual environments
MIT License
1.06k stars 100 forks source link

Use tool versions file to colorize `ls --details` #212

Closed justinmayer closed 3 years ago

justinmayer commented 3 years ago

Previously, environment Python versions in the list shown by vf ls --details were only considered to be up-to-date (i.e., displayed in green) when a given environment's Python version is greater or equal to the default Python version returned by __vfsupport_get_default_python(). If you have some environments on older but fully-supported Python versions, those would show up in yellow even though they should be considered up-to-date.

With these changes, given a ~/.tool-versions file that contains the following line:

python 3.9.7 3.8.12 3.7.11 3.6.14

… any environment's Python version that matches one of the specified versions will be considered up-to-date and displayed in green.

justinmayer commented 3 years ago

As I mentioned previously, I would like to eventually enhance this further by retrieving the most up-to-date supported Python version numbers from some kind of API (e.g., curl https://example.com/python/versions/active/patch) and using that information instead of a manually-updated ~/.tool-versions line entry. Hopefully some day such an API will exist. 🤞

Otherwise, perhaps scraping the Python downloads page is the most realistic approach.

In any case, for now I believe this manual approach will do the job. 💫