question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Test adoption of the new Python Extension API

See original GitHub issue

Testing adoption of the new Python Extension API for discovering Python Enviornmnents

Refs: #7583

Complexity: 5

Authors: @DonJayamanne

Create Issue


Pre-Test

  • Keep track of the kernels displayed in the kernel picker

Requirements

  • Install pre-release Jupyter extension
  • Install pre-release Python extension
  • Install VS Code Insiders

Scenarios to test

  • Verify the same kernels (kernel specs and Python environments) are still displayed in the kernle picker

  • New Virtual environments are detected and displayed in the Kernel picker Note: You need to have already executed a cell in some notebook Then create a virtual environment within VS Code I.e. the goal is to test detection of new virtual envs after the extension has been used for a while

    • Verify you are prompted to install IPyKernel into this Python enviornment when running a Notebook cell against this kernel
    • Verify you are prompted to install IPyKernel into this Python enviornment when running an Interactive Window cell such a new Python Environment (either re-create a new env or uninstall IPyKernel)
    • Verify you are prompted to install Pandas data frame into this Python enviornment when using the Data Frame viewer To test this, create a few variables, at least one with a list e.g. a = [1,2,3] and use the variable viewer to open the variable a
  • New Conda environments are detected and displayed in the Kernle picker Note: You need to have already executed a cell in some notebook Then create a conda environment within VS Code I.e. the goal is to test detection of new virtual envs after the extension has been used for a while

    • Verify you are prompted to install IPyKernel into this Python enviornment when running a Notebook cell against this kernel
    • Verify you are prompted to install IPyKernel into this Python enviornment when running an Interactive Window cell such a new Python Environment (either re-create a new env or uninstall IPyKernel)
    • Verify you are prompted to install Pandas data frame into this Python enviornment when using the Data Frame viewer To test this, create a few variables, at least one with a list e.g. a = [1,2,3] and use the variable viewer to open the variable a
  • Re-load VS Code and verify you can pick a Kernel Spec before Python environments I’m hoping some machines are slow enough and we can see Kernel Specifications before Python environments in the kernel picker. In the past we regressed in this space and Jupyter extension waited for ALL python environnents to be loaded before displaying Kernel Specs on disc. We’re verifyhing the fact that some kernels will appear before others

  • Verify local kernel specs appera before Remote Kernel specs Connect to a local Jupyter server after having started a jupyter server using jupyter notebook --no-browser --NotebookApp.allow_origin=* In the past we regressed in this space and Jupyter extension waited for ALL python environnents to be loaded before displaying Kernel Specs on disc. We’re verifyhing the fact that some kernels will appear before others

  • Verify debugging works and uses the right Python environment

  • Test other parts of the extension that you believe could be impacted by adopting the new Python Extension API

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:15 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
IanMatthewHuffcommented, Oct 25, 2022

How do I do this? I’ve only ever used the conda terminal to work directly with conda.

Python did add a new Python Create Environment Command, I’m testing both that and creating one manually.

0reactions
DonJayamannecommented, Oct 26, 2022

Does this just mean I should see environments loaded gradually, rather than none until they are all available?

If you are lucky to have a slow machine, then yo’ll see environments load gradually. Its unlikely you’ll have none, as the Python Extension API returns the active interpreter pretty quickly, hence you’ll most likely see at least one python env in the list.

Re-load VS Code and verify you can pick a Kernel Spec before Python environments

Sorry, I should have been more specific. I shoudl have stated that you can pick kernel specs before ALL python envrionmetns are loaded. I.e. over time you should see more & more python envs getting added to the list. However kernel specs should be loaded very quickly in comparison.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Test finalized API for python environments #19886 - GitHub
Try dry-adopting it in the Jupyter extension for discovery of Python environments and make sure it covers all scenarios. Example usage: Copy ...
Read more >
PEP 605 – A rolling feature release stream for CPython
PEP 602 proposes that affected organisations and projects simply switch to adopting every second or third CPython release, rather than attempting to adopt...
Read more >
Migrate from v1 to v2 - Azure Machine Learning | Microsoft Learn
Migrate from v1 to v2 of Azure Machine Learning REST APIs, CLI extension, and Python SDK.
Read more >
March 2022 (version 1.66) - Visual Studio Code
Learn what is new in the Visual Studio Code March 2022 Release (1.66) ... to issues and pull requests but can be adopted...
Read more >
Documenting Extensions — kit-manual 104.0 documentation
The best way to document our Python API is to do so directly in the code. ... we have adopted the more streamlined...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found