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

Test finalized API for python environments #19886

Closed
2 tasks done
karrtikr opened this issue Sep 26, 2022 · 6 comments
Closed
2 tasks done

Test finalized API for python environments #19886

karrtikr opened this issue Sep 26, 2022 · 6 comments
Labels
testplan-item verified Verification succeeded

Comments

@karrtikr
Copy link

karrtikr commented Sep 26, 2022

Refs: #19101

Complexity: 5

Create Issue


Requirements

Pre-assigning Jupyter team, but note builds are not available yet, testing begins tomorrow.

  1. Use Pre release build of the python extension
  2. Have as many types of environments as you can.
  3. Interesting types to test: Conda, Pyenv global installs, Pyenv conda envs etc.

Test APIs exposed via ProposedExtensionAPI

Example usage:
Copy over contents of https://github.com/microsoft/vscode-python/blob/main/src/client/proposedApiTypes.ts#L8 as needed.

const extension = extensions.getExtension('ms-python.python');
if (extension) {
    if (!extension.isActive) {
        await extension.activate();
    }
    const api: IExtensionApi & ProposedExtensionAPI = extension.exports as IExtensionApi & ProposedExtensionAPI;
    if (api.environment) {
        const envPath =  api.environment.getActiveEnvironmentPath();
    }
}
@IanMatthewHuff
Copy link
Member

IanMatthewHuff commented Sep 27, 2022

Right now I'm testing this with a separate extension as opposed to trying to fully adopt into Jupyter. Seemed like a fairer test of the API itself.

  • After refresh list of envs looks correct in .all
  • getActiveEnvironmentPath returns the correct Env, as well as after a change
  • After calling resolveEnvironment the env looks correct (venv, conda, global, pyenv)
  • updateActiveEnvironmentPath updates the environment
  • onDidChangeActiveEnvironmentPath fires corrected with the right arg (and doesn't file if update parameter is already active)
  • onDidChangeEnvironments changes when adding a new Env
  • Cancellation token works on a full force refresh

@karrtikr
Copy link
Author

Yep, by dry-adopting I mean we should make sure it covers all scenarios in the Jupyter extension.

@IanMatthewHuff
Copy link
Member

Yep, by dry-adopting I mean we should make sure it covers all scenarios in the Jupyter extension.

That seems a bit much for a single TPI. But so far things all look good with it. Maybe Don knows better if we can just drop this in quickly.

@IanMatthewHuff IanMatthewHuff removed their assignment Sep 27, 2022
@DonJayamanne
Copy link

DonJayamanne commented Sep 28, 2022

i agree with Ian, it's impossible to cover ALL scenrios in a TPI without adopting this in jupyyer extension

if you're plan is to finalize the api based on feedback from jupyter extension adoption, then i don't think we can finalize this api now.
All we (jupyter extension) can do is test this with a simple sample and provide some feedback.

we will discuss this in our stand-up.

@karrtikr
Copy link
Author

I see, in that case just testing and feedback would suffice for purposes of this TPI.

Will discuss with the team on when we plan to finalize it.

@karrtikr
Copy link
Author

So I talked with the team and decided that we'll finalize it in an iteration or two, hope that gives Jupyter some time to adopt the API. Meanwhile we'll still announce it in our blog posts and release notes to get additional feedback!

@DonJayamanne DonJayamanne removed their assignment Sep 28, 2022
@DonJayamanne DonJayamanne added the verified Verification succeeded label Sep 28, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
testplan-item verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants