Skip to content

Expose API for when the list of interpreters have changed #17004

Closed

Description

Discussed in #16683

Originally posted by DonJayamanne July 13, 2021
Currently there's no way for Jupyter to know when user creates a new Python environment (conda, or the like).

Is it possible to get an event so we know that new interpreters have been created.

Note: Once thats done, how would we get these new interpreters. Not sure the GetInterrpeters is the best API for this, as that will return all interpreters all over again. Personally it would be nice to have something we can subscribe to, like an observable, this way we only get whats new).

Activity

  1. DonJayamanne commented on Aug 17, 2021

    @DonJayamanne

    ersonally it would be nice to have something we can subscribe to, like an observable, this way we only get whats new).

    Yup, that was my original plan for how the interpreters could be exposed.
    #3023

    Having an observable is a very efficient way for Jupyter as well. E.g. we don't need to wait till we get all interpreters just to know that the user has an interpreter, similarly when we search for kernels we don't need to wait for all when we can start searching incrementally. (these were some of the perf improvements we discussed when looking at the delays in Jupyter extension)

  2. brettcannon commented on Sep 1, 2021

    @brettcannon
    MemberAuthor

    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.

  3. brettcannon commented on Oct 15, 2021

    @brettcannon
    MemberAuthor

    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.

  4. karthiknadig commented on Jan 19, 2022

    @karthiknadig
    Member

    This is now available via the proposed API for the python extension, please try this out and let us know.

    Event for when the interpreter list changes:

    onDidInterpretersChanged: Event<InterpretersChangedParams[]>;

    API to get currently know interpreters:

    getInterpreterPaths(): Promise<string[] | undefined>;

    API to get details for a given interpreter path:

    getInterpreterDetails(

    API to get the refresh promise, this will return a promise for the current ongoing discovery:

    getRefreshPromise(): Promise<void> | undefined;

    API to trigger refresh of environments:

    refreshInterpreters(options?: RefreshInterpretersOptions): Promise<string[] | undefined>;

  5. brettcannon commented on Dec 14, 2022

    @brettcannon
    MemberAuthor

    I believe the API supports notification of when the interpreter list has changed, so closing as done.

  6. locked as resolved and limited conversation to collaborators on Jan 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-environmentsFeatures relating to handling interpreter environmentscommunity askFeature request that the community expressed interest infeature-requestRequest for new features or functionalityneeds proposalNeed to make some design decisions

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions