Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: symlink to latest version in cache #160

Open
tekumara opened this issue Mar 12, 2023 · 3 comments
Open

Feature request: symlink to latest version in cache #160

tekumara opened this issue Mar 12, 2023 · 3 comments

Comments

@tekumara
Copy link

pyright-python maintains a cache of versions, eg:

❯ ls ~/.cache/pyright-python/
1.1.296 1.1.298

It would be nice to have a stable latest symlink to to the latest version, eg:

❯ ls -al ~/.cache/pyright-python/
total 0
drwxr-xr-x   5 tekumara  staff  160 13 Mar 09:49 .
drwxr-xr-x  15 tekumara  staff  480 13 Mar 09:48 ..
drwxr-xr-x   5 tekumara  staff  160  6 Mar 12:13 1.1.296
drwxr-xr-x   5 tekumara  staff  160 13 Mar 09:48 1.1.298
lrwxr-xr-x   1 tekumara  staff    7 13 Mar 09:49 latest -> 1.1.298

A stable symlink could be used globally, from any bash script/Makefile commands, or for interactive usage.

(It also avoids going through the python interpreter and so has a lower startup time).

@tekumara
Copy link
Author

I'd be happy to raise a PR for this if you think it worthwhile.

@RobertCraigie
Copy link
Owner

Yeah this seems pretty reasonable.

I'm curious what your exact use case is though? This cache isn't intended to be part of the public API.

for interactive usage

What do you mean by this exactly? Is there something interactive that isn't working in the main wrapper?

@tekumara
Copy link
Author

tekumara commented Mar 13, 2023

Thank you for considering this!

The main wrapper works well. By interactive usage I mean someone running pyright on the command line and waiting for results as opposed to CI or elsewhere.

With interactive usage I notice the ~100ms startup delay from the python interpreter when going via the main wrapper, rather than via eg: $HOME/.cache/pyright-python/latest/node_modules/pyright/index.js.

I appreciate this may be a niche concern though 😂 And you make a good point that it's not part of the public API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants