September Update | Visual Studio Code Python
Click on the blue text above
Follow us
(Reading time for this article: 7 minutes)
We're excited to announce that the September 2022 Python and Jupyter extensions for Visual Studio Code are now available!
This release includes the following improvements:
- Improved IntelliSense support for Jupyter notebooks
- A new Flake8 extension
- Pilot features: improved unit tests and notebook image pasting
If you're interested, you can check out the full improvement log for Python, Jupyter, and Pylance extensions in our changelog.
- Python 1: https://marketplace.visualstudio.com/items?itemName=ms-python.python
- Jupyter 1: https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter
- Python 2:
- Jupyter 2:
- Pylance:
Improved IntelliSense support for Jupyter notebooks
IntelliSense support is now more complete when using Pylance for Jupyter Notebooks using the Python kernel, thanks to updated Jupyter support in the Language Server Protocol.
When writing Python code in a notebook file, you not only get improved autocomplete suggestions, but you can also use refactoring features such as extract variables, extract methods, and auto-import.
Subject: Horizon Extended https://marketplace.visualstudio.com/items?itemName=LanceWilhelm.horizon-extended
Pylance: https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance
IntelliSense:
Updates in Language Server Protocol:
Flake8 extension
After releasing the pylint, black and isort extensions, we are now happy to announce that we have a new flake8 extension! Like the other extensions, this new extension uses the Language Server Protocol to provide linting support, and since it ships with the latest version of Flake8, you no longer need to install Flake8 in your Python environment.
You can use it directly with the Pylint extension since the two do not conflict:
- Subject: Horizon Extended
https://marketplace.visualstudio.com/items?itemName=LanceWilhelm.horizon-extended
Subject: Horizon Extended
https://marketplace.visualstudio.com/items?itemName=LanceWilhelm.horizon-extended
You can install this new extension from the market to try it out. If you have any questions or feature requests, you can submit them to the Flake8 extension's GitHub repository.
- pylint:
https://marketplace.visualstudio.com/items?itemName=ms-python.pylint
- black: https://marketplace.visualstudio.com/items?itemName=ms-python.black-formatter
- isort: https://marketplace.visualstudio.com/items?itemName=ms-python.isort
- flake8: https://marketplace.visualstudio.com/items?itemName=ms-python.flake8
- Install from Marketplace: https://marketplace.visualstudio.com/items?itemName=ms-python.flake8
- GitHub repository for the Flake8 extension: https://marketplace.visualstudio.com/items?itemName=ms-python.flake8
pylint:
https://marketplace.visualstudio.com/items?itemName=ms-python.pylint
Pilot features: improved unit tests and notebook image pasting
▌Improved unittest support
This summer, the Python Extension team is excited to welcome a new intern, Anthony Kim. During his internship, he worked on improving running tests with unittest. He also started researching how to improve pytest support in the Python extension, but unfortunately his 12 weeks with us was too short to implement these additional changes.
The team is continuing his improvement work, stay tuned for our improvements to pytest.
▌Notebook picture paste
We also welcome Michael Lively as our Jupyter Extensions team intern, where his job is to paste screenshots and image files into Markdown cells in notebooks.
It currently supports image/png types, you can add the following settings to use this feature:
The team will continue to improve this feature to support different image types.
We would like to thank both interns for their hard work and hope they enjoy the internship! If you're interested in learning more about the Anythony project, you can check out episode 6 of the Sad Python Girls Club Podcast co-hosted by our team members.
- Anthony Kim:
- Improve running tests with unittest:
- Michael Lively:
https://github.com/Yoyokrazy?ocid=AID3045631
- Episode 6 of the Sad Python Girls Club Podcast: https://anchor.fm/sad-python-girls-club/episodes/Episode-6---Anthony-Kim-e1n0lvp
Michael Lively:
https://github.com/Yoyokrazy?ocid=AID3045631
Other changes and enhancements
We've also added some small enhancements and user-requested fixes that should improve your experience with Python and Jupyter Notebooks in Visual Studio Code. Some notable changes include:
- You can now clear and refresh the list of Python interpreters via a new button in the selector (vscode-python#19628)
- Debugpy updated to version 1.6.3 (vscode-python#19698)
- Pylance now no longer displays false warnings when importing Python modules/files in Jupyter (pylance-release#3017)
- Renaming symbols between different cells in Jupyter no longer fails when using Pylance (pylance-release#3061)
- IntelliSense support for matplotlib when using Pylance has been improved due to an update to matplotlib type stubs (python-type-stubs#223)
We would also particularly like to thank this month's contributors:
- cpinamtz: fix HOME folder substitution not in start path (vscode-python#19326)
- parched: only show args for pytest parameterized tests ( vscode-python#19479 )
parched: only show args for pytest parameterized tests ( vscode-python#19479 )
- cpinamtz:
- vscode-python#19326:
- parched: https://github.com/parched?ocid=AID3045631
- vscode-python#19479:
https://github.com/microsoft/vscode-python/pull/19479?ocid=AID3045631
vscode-python#19479:
https://github.com/microsoft/vscode-python/pull/19479?ocid=AID3045631
Try these new improvements by updating or downloading the Python and Jupyter extensions 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 Visual Studio Code Python in the documentation. If you run into any issues or have suggestions, please file an issue on the Python VS Code GitHub page.
- Python extension: https://marketplace.visualstudio.com/items?itemName=ms-python.python
- Jupyter extension: https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter
- Documentation:
- GitHub:
- submit questions:
Welcome to the official Python in Visual Studio Code site to learn more.
Latest Programming News and Information | GeekBar