Python in Visual Studio Code – July 2023 Release
This release includes the following announcements:
- Mypy extension in preview
- Debugpy extension in preview
- Pylance localization
- Index persistance for 3rd-party libraries with Pylance
- Upcoming deprecation of Python 3.7 support
Mypy extension in preview
If you have any issues with this new extension or wish to provide feedback, please file an issue in the Mypy extension GitHub repo.
Debugpy extension in preview
When support for Python 2.7 and Python 3.6 were removed from the Python extension, we received a lot of feedback from users who were unable to upgrade their codebase to the latest versions of Python and lost the ability to debug their applications with the latest versions of the Python extension. To work towards a solution for this, we have created a separate Python Debugger extension called Debugpy. By keeping the debugger separate from the Python extension, you will eventually be able to use the latest version of the Python extension while using an older version of the debugger (by disabling extensions auto-update). This extension is available in preview as a pre-release version using the latest version of debugpy. We plan to support older versions in the near future.
Please give it a try and let us know if everything works as expected. Our plan is to deprecate the built-in debugging functionality in favour of this separate extension.
The Pylance extension is now localized! This means commands and other text from the extension will be translated to your preferred language if you have a Language Pack installed and set to active in VS Code.
Index persistence for 3rd-party libraries with Pylance
Pylance performs indexing of 3rd party libraries that are installed in your environment to enable IntelliSense features such as auto-completion, auto-import, code navigation, etc. Previously, Pylance would index these libraries every time you opened a workspace in VS Code. Now, Pylance will persist the index for these libraries, reducing the need for repetitive indexing processes.
Upcoming deprecation of Python 3.7 support
Python 3.7 reached end-of-life (EOL) on 2023-06-27. As such, official support for Python 3.7 from the Python extension will stop in three months in the 2023.18 release of the extension (which corresponds with the September 2023 release of VS Code). There are no plans to actively remove support for Python 3.7, and so we expect the extension will continue to work unofficially with Python 3.7 for the foreseeable future.
With all other releases of Python now on an annual release cadence, we expect to stop official support for a Python release once it reaches EOL in the first extension release of the following calendar year (i.e., Python 3.8 is scheduled to reach EOL in October 2024, so the first extension release in 2025 will stop official support).
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:
PythonTestAdapterexperiment is currently enabled for everyone using the latest pre-release version of the Python extension and will begin to be rolled out to the release version this month. This experiment enables dynamic run results for pytest and unittest, where test results are delivered individually, allowing you to see tests pass and fail in real time.
- Recommendation for linters and formatters extensions if tool is listed in pyproject.toml (vscode-python#21458)
We would also like to extend special thanks to this month’s contributors:
- @kev-odin made their first contribution in vscode-black-formatter#235
- @DetachHead made their first contribution in vscode-mypy#33
- @Avasam made their first contribution in vscode-mypy#58
- @vidhanio made their first contribution in vscode-mypy#64
- @DudeNr33 made their first contribution in vscode-pylint#298
- @diksown made their first contribution in vscode-isort#174
- @Molkree made their first contribution in vscode-isort#208
- @hamirmahal made their first contribution in vscode-isort#256
- @dciborow made their first contribution in vscode-flake8#131
- @TimStricker made their first contribution in vscode-flake8#165
- @SruthiSathya made their first contribution in vscode-flake8#168
- @kyoto7250 made their first contribution in vscode-flake8#176
Try out these new improvements by 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.