📜 ⬆️ ⬇️

Python in Visual Studio Code - June Release

We are pleased to announce that the Python extension for Visual Studio Code of June 2019 is already available. You can download the Python extension from the Marketplace or install it directly from the extension gallery in Visual Studio Code. If you already have the Python extension installed, you can also get the latest update simply by restarting Visual Studio Code. You can learn more about Python support in Visual Studio Code in the documentation .

In this release, we have made improvements that are listed in our change log by solving a total of 70 problems, including with the graph viewer with the Python Interactive window and parallel tests with pytest. Read about all the changes under the cut.


')

Plot Viewer with Python window


Graphs are commonly used to visualize data. One of the most popular features of the Python interactive window is the ability to more deeply view the created graphs, such as zooming, panning and exporting them. The June update includes a completely new viewer that can be used to work with any graph images, such as from the matplotlib library.

You can open the viewer by double-clicking on the graphic or by clicking on the “expand image” button, which is displayed when you hover over graphic images in the interactive Python window:



With the graph viewer, you can move graphs, zoom in and out, switch between graphs in the current session, and export them to PDF, SVG, or PNG.

Pytest Parallel Tests


We have made improvements in the reliability of the statistics displayed for running tests, in particular, for running tests in parallel with pytest.

You can run tests in parallel with pytest by installing the pytest-xdist package and adding “-n <number of processors>” to the configuration file. For example, for 4 processors, you can create a pytest.ini file in the project folder and add the following content to it:

[pytest] addopts=-n4 

Now, when you run and debug tests, they will run in parallel.



You can refer to our documentation to learn more about testing support in the Python extension.

Indents at selective start in the terminal


In our GitHub repository , the VS Code Python function is extremely demanded , which cleared common indents from the selected code before sending it to the terminal when running the Run Selection / Line in Python Terminal command. Starting with this release, the team will send a code to the terminal with the common indentation removed, based on the first non-empty line of the highlighted code.



Other changes and improvements.


We also added minor improvements and fixed issues that were reported to us by users. The following are some notable changes:


Be sure to install the Python extension for Visual Studio code right now to appreciate the above innovations. If you have any problems, please report it on the Python VS Code GitHub page.

Source: https://habr.com/ru/post/457186/


All Articles