Python in Visual Studio Code – September 2022 Release
We’re excited to announce that the September 2022 release of the Python and Jupyter extensions for Visual Studio Code are now available!
This release includes the following announcements:
- Improved IntelliSense support for Jupyter Notebooks
- A new Flake8 extension
- Internship highlight: improved unittest support and notebook image pasting
If you’re interested, you can check the full list of improvements in our changelogs for the Python, Jupyter and Pylance extensions.
Improved IntelliSense Support for Jupyter Notebooks
IntelliSense support for Jupyter Notebooks with Python kernels is now much better when using Pylance, thanks to the updates in the Language Server Protocol to include notebook support.
Not only you will get improved auto complete suggestions when writing Python code in notebook files, but you will also be able to leverage refactoring features such as extract variable, extract method as well as auto imports.
Theme: Horizon Extended
After releasing extensions for pylint, black and isort, we are now excited to announce we also have a new flake8 extension! Much like the others, this new extension uses the Language Server Protocol to provide linting support, and because it ships with the latest version of Flake8, you’re no longer required to have it installed in a Python environment.
You can also use it side by side with the Pylint extension, as one doesn’t conflict with the other:
Theme: Horizon Extended
You can try this new extension out today by installing it from the marketplace. If you have any issues or feature requests, you can file them at the Flake8 extension’s GitHub repository.
Internship highlight: improved unittest support & notebook image pasting
Improved unnittest support
This summer the Python extension team was happy to welcome a new intern, Anthony Kim. During his internship, he worked on improving support for running tests with unittest. He also started researching what it would take to improve pytest support in the Python extension, but unfortunately his 12 weeks with us ended up being too short for these additional changes to be implemented.
The team is picking up where he left off, and his changes will be available once we are ready to ship all our pytest support improvements.
Notebook image pasting
We also welcomed Michael Lively as our Jupyter extension team intern where he worked on pasting screenshots and image files into Markdown cells in notebooks.
It currently supports the image/png mime type, and you can add/enable the following settings to use the feature:
"ipynb.experimental.pasteImages.enabled": true "editor.experimental.pasteActions.enabled": true
The team will continue to improve this feature to support different image types.
We’d like to thank both of our interns for their hard work, and we hope they enjoyed their internships! If you’re interested in learning more about Anythony’s project, you can check out episode #6 of the Sad Python Girls Club Podcast, co-hosted by one of our team members.
Other Changes and Enhancements
We have also added small enhancements and fixed issues requested by users that should improve your experience working with Python and Jupyter Notebooks in Visual Studio Code. Some notable changes include:
- You can now clear and refresh the Python interpreters list through a new button in the picker (vscode-python#19628).
- Debugpy has been updated to version 1.6.3 (vscode-python#19698)
- Pylance is now longer showing false warnings when importing a Python module/file in a Jupyter notebook (pylance-release#3017).
- Renaming symbols across different cells in Jupyter notebooks no longer fails when using Pylance (pylance-release#3061).
- IntelliSense support for matplotlib has been improved when using Pylance thanks to updates on matplotlib type stubs (python-type-stubs#223).
We would also like to extend special thanks to this month’s contributors:
- cpinamtz: Fix HOME folder substitution when is not in the beginning of path (vscode-python#19326).
- parched: Only show args for pytest parameterized test (vscode-python#19479).
Try out these new improvements by updating or downloading the Python extension and the Jupyter extension from the Marketplace, or install them directly from the extensions view in Visual Studio Code (Ctrl + Shift + X or ⌘ + ⇧ + X). You can learn more about Python support in Visual Studio Code in the documentation. If you run into any problems or have suggestions, please file an issue on the Python VS Code GitHub page.