-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Provide a public API to set the environment to a given path #16994
Comments
Thanks for the feature request! We are going to give the community 60 days from when this issue was created to provide 5 👍 upvotes on the opening comment to gauge general interest in this idea. If there's enough upvotes then we will consider this feature request in our future planning. If there's unfortunately not enough upvotes then we will close this issue. |
Thank you to everyone who upvoted this issue! Since the community showed interest in this feature request we will leave this issue open as something to consider implementing at some point in the future. We do encourage people to continue 👍 this issue as it helps us prioritize our work based on what the community seems to want the most. |
Hi, any news on this front? This is causing more and more problems when trying to use isolated Python environments. For a bit of background why this is a big thing (to us at least) is that in RPA space we cannot assume that the end-users know how to manage and install Python versions on their machines so the normal "works for me" that developers can easily solve makes things impossible when deploying. So we built a toolchain around actually making repeatable, isolated python environment setups so that we can also reliably cache things between different environments: https://github.com/robocorp/rcc/blob/master/docs/environment-caching.md So this is how we can execute python-based items reliable on just about any platform so now it would be critical that the developer see the same thing in their tooling and actually stop relying on: "I have Python x.y installed and in PATH, you need to do that l as well". |
The update is we have v1 of our read-only API designed, implemented, and we are starting to use it within the extension to make sure it works (the hope is to have this work done by our next release in February). We are then going to make sure first-party extensions have their needs met with the API. After that validation the API will go public be considered ready for use. Once our public API has gone out we can discuss providing an API to allow other extensions to set the selected environment. We will very likely lean on the community for proposing a design, justifying it, etc. since we have no need for such an API. P.S.: I somewhat disagree with using that XKCD comic to prove a point. 😉 |
Pinging here as we saw the Python iteration plan: #18214 Seeing "Implement the proposed public API for the extension and use it internally vscode-python#17905" there and that related issue (#17905) is closed already, leads one to believe that at least some API already done, but is it coming out or..? So the other direct question is when is this release planned to happen that drops the experiment phase? We are also trying to deduce another way based on this: https://github.com/microsoft/vscode-python/wiki/AB-Experiments#tldr @brettcannon we have well over 1k active users building RPA bots with VS Code that really kind of depend on this, so I'd like to get ahead of the problem as much as possible 😅 |
@kariharju That (#17905) got closed by mistake. I am working on the proposed public API, I will post here when it is in. |
@kariharju This is now in main. The API to set active python interpreter looks like this vscode-python/src/client/apiTypes.ts Line 149 in 262019b
|
This build has the |
Awesome! |
Great we now have an implementation that uses the API if/when it exists and if not we call |
Note API name is now changed, see https://github.com/microsoft/vscode-python/blob/main/src/client/proposedApiTypes.ts#L23 Feature (#19841) should be out in the pre-release version of the extension in a day, use the following to try it out: |
Discussed in #16504
Originally posted by brettcannon June 16, 2021
I have an extension that currently changes the python executable being used by setting it in the user or workspace settings.json (depending how the user chooses to do it).
In the description of https://github.com/microsoft/vscode-python/wiki/AB-Experiments#deprecatepythonpath, I can't really see any way for an extension to update the python used by the vscode-python extension after the move to stop using the settings.json.
So, this is a request to provide an API/command to provide parity with what was already available prior to this change (or if there is already a way to do it, document it in https://github.com/microsoft/vscode-python/wiki/AB-Experiments#deprecatepythonpath).
Originally posted by @fabioz in a discussion
The text was updated successfully, but these errors were encountered: