Skip to content

Avoid caching packages #472

@DonJayamanne

Description

@DonJayamanne

I think this should be avoided, as it is this is causing a few issues in Jupyter.
E.g. i can uninstall/install packages from Jupyter extension by running code like %pip install in a cell
This is valid jupyter code, and very commonly used practice.

However the Python env tools returns stale information, hence the Python tools used in Copilot return stale information.
Restarting Jupyter kernels. or restarting the chat doesn't fix the issue, I need to reload VS Code.

Not sure why we need the cache, but i think its fair to say that we've learnt that caching can cause a lot of issues.

    async getPackages(environment: PythonEnvironment): Promise<Package[] | undefined> {
        if (!this.packages.has(environment.envId.id)) {
            await this.refresh(environment);
        }
        return this.packages.get(environment.envId.id);
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue identified by VS Code Team member as probable bugimportantIssue identified as high-priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions