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.

Take 2: Testing adoption of the new Python Extension API for discovering Python Environments

See original GitHub issue

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

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:21 (21 by maintainers)

github_iconTop GitHub Comments

1reaction
IanMatthewHuffcommented, Oct 31, 2022

So the behavior for me does seem to indicate that Python extension might be having the issue. What I see is the following.

  1. create new .venv (using the terminal, not sure about the create env command)
  2. .venv doesn’t show up in jupyter list or python interpreter list even after a long wait
  3. go to python interpreter list and refresh
  4. .venv in is python interpreter list and is in jupyter interpreter list

Given that it shows up for me in Jupyter as soon as it’s seen in Python I would flag that as on the Python side. But given that @roblourens was seeing differently (seeing it in the Python list but not in Jupyter) my confidence is really low here.

0reactions
DonJayamannecommented, Nov 27, 2022

Closing this stale issue

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:
Read more >
Using Python environments in VS Code
This article discusses the helpful Python environments features available in Visual Studio Code. An "environment" in Python is the context in which a...
Read more >
VSCode pytest test discovery fails - python - Stack Overflow
Use Python code for discovery of tests when using pytest. (#4795) ... Seems like a bug in the latest version of VS Code...
Read more >
Pipenv: A Guide to the New Python Packaging Tool
Pipenv is a packaging tool for Python that solves some common problems associated with the typical workflow using pip, virtualenv, and the good...
Read more >
Python Best Practices for a New Project in 2021 - Alex Mitelman
How to use pytest with VS Code? As an intentionally oversimplified example, let's create and test function that multiplies two numbers.
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