We’re excited to announce the July 2024 release of the Python and Jupyter extensions for Visual Studio Code!
This release includes the following announcements:
- Enhanced environment discovery with python-environment-tools
- Improved support for reStructuredText docstrings with Pylance
- Community contributed Pixi support
If you’re interested, you can check the full list of improvements in our changelogs for the Python, Jupyter and Pylance extensions.
Enhanced environment discovery with python-environment-tools
We are excited to introduce a new tool, python-environment-tools, designed to significantly enhance the speed of detecting global Python installations and Python virtual environments.
This tool leverages Rust to ensure a rapid and accurate discovery process. It also minimizes the number of Input/Output operations by collecting all necessary environment information at once, significantly enhancing the overall performance.
We are currently testing this new feature in the Python extension, running it in parallel with the existing support, to evaluate the new discovery performance. Consequently, you will see a new logging channel called Python Locator
that shows the discovery times with this new tool.
This enhancement is part of our ongoing efforts to optimize the performance and efficiency of Python support in VS Code. Visit the python-environment-tools repo to learn more about this feature, ongoing work, and provide feedback!
Improved support for reStructuredText docstrings with Pylance
Pylance has improved support for rendering reStructuredText documentation strings (docstrings) on hover! RestructuredText (RST) is a popular format for documentation, and its syntax is sometimes used for the docstrings of Python packages.
This feature is in its early stages and is currently behind an experimental flag as we work to ensure it handles various Sphinx, Google Doc, and Epytext scenarios effectively. To try it out, you can enable the experimental setting python.analysis.supportRestructuredText
.
Common packages where you might observe this change in their docstrings include pandas
and scipy
. Try this change out, and report any issues or feedback at the Pylance GitHub repository.
Note: This setting is currently experimental, but will likely be enabled by default in the future as it becomes more stabilized.
Community contributed Pixi support
Thanks to @baszalmstra, there is now support for Pixi environment detection in the Python extension! This work added a locator to detect Pixi environments in your workspace similar to other common environments such as Conda. Furthermore, if a Pixi environment is detected in your workspace, the environment will automatically be selected as your default environment.
We appreciate and look forward to continued collaboration with community members on bug fixes and enhancements to improve the Python experience!
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:
- Smart Send with
Shift+Enter
is now available in the VS Code Native REPL for Python (@vscode-python23638) - Support
pytest
parameterized tests spanning multiple classes when calling the same setup function (@vscode-python#23535) - Bug fix to have load bar show during test discovery (@vscode-python#23537)
We would also like to extend special thanks to this month’s contributors:
- @covracer Restore execute bits on deactivate scripts in vscode-python#23620
- @nickwarters Activate Python extension when
.venv
or.conda
is found in the workspace in vscode-python#23642 - @baszalmstra Add locator for Pixi environments in vscode-python#22968
- @DetachHead Add hook to
vscode-pytest
to determine numberxdist
workers to use based on count of selected tests in vscode-python#23539
Call for Community Feedback
As we are planning and prioritizing future work, we value your feedback! Below are a few issues we would love feedback on:
- Design proposal for test coverage in (@vscode-python#22827)
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.
0 comments