{"id":9761,"date":"2024-07-09T07:45:29","date_gmt":"2024-07-09T15:45:29","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/python\/?p=9761"},"modified":"2024-07-09T07:47:16","modified_gmt":"2024-07-09T15:47:16","slug":"python-in-visual-studio-code-july-2024-release","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/python\/python-in-visual-studio-code-july-2024-release\/","title":{"rendered":"Python in Visual Studio Code &#8211; July 2024 Release"},"content":{"rendered":"<p>We\u2019re excited to announce the July 2024 release of the <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-python.python\">Python<\/a> and <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-toolsai.jupyter\">Jupyter<\/a> extensions for Visual Studio Code!<\/p>\n<p>This release includes the following announcements:<\/p>\n<ul>\n<li>Enhanced environment discovery with python-environment-tools<\/li>\n<li>Improved support for reStructuredText docstrings with Pylance<\/li>\n<li>Community contributed Pixi support<\/li>\n<\/ul>\n<p>If you\u2019re interested, you can check the full list of improvements in our changelogs for the <a href=\"https:\/\/github.com\/microsoft\/vscode-python\/releases\">Python<\/a>, <a href=\"https:\/\/code.visualstudio.com\/updates\/\">Jupyter<\/a> and <a href=\"https:\/\/github.com\/microsoft\/pylance-release\/blob\/main\/CHANGELOG.md\">Pylance<\/a> extensions.<\/p>\n<h2>Enhanced environment discovery with python-environment-tools<\/h2>\n<p>We are excited to introduce a new tool, <a href=\"https:\/\/github.com\/microsoft\/python-environment-tools\">python-environment-tools<\/a>, designed to significantly enhance the speed of detecting global Python installations and Python virtual environments.<\/p>\n<p>This tool leverages <a href=\"https:\/\/www.rust-lang.org\/\">Rust<\/a> 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.<\/p>\n<p>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 <code>Python Locator<\/code> that shows the discovery times with this new tool.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2024\/07\/python-environment-tool-output.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-9762\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2024\/07\/python-environment-tool-output.png\" alt=\"Python Locator output channel.\" width=\"1888\" height=\"573\" srcset=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2024\/07\/python-environment-tool-output.png 1888w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2024\/07\/python-environment-tool-output-300x91.png 300w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2024\/07\/python-environment-tool-output-1024x311.png 1024w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2024\/07\/python-environment-tool-output-768x233.png 768w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2024\/07\/python-environment-tool-output-1536x466.png 1536w\" sizes=\"(max-width: 1888px) 100vw, 1888px\" \/><\/a><\/p>\n<p>This enhancement is part of our ongoing efforts to optimize the performance and efficiency of Python support in VS Code. Visit the <a href=\"https:\/\/github.com\/microsoft\/python-environment-tools\">python-environment-tools repo<\/a> to learn more about this feature, ongoing work, and provide feedback!<\/p>\n<h2>Improved support for reStructuredText docstrings with Pylance<\/h2>\n<p>Pylance has improved support for rendering reStructuredText documentation strings (docstrings) on hover! <a href=\"https:\/\/www.sphinx-doc.org\/en\/master\/usage\/restructuredtext\/index.html\">RestructuredText<\/a> (RST) is a popular format for documentation, and its <a href=\"https:\/\/peps.python.org\/pep-0287\/\">syntax is sometimes used for the docstrings of Python packages<\/a>.<\/p>\n<p>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 <code>python.analysis.supportRestructuredText<\/code>.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2024\/07\/pylance-restructuredtext.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-9763\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2024\/07\/pylance-restructuredtext.png\" alt=\"Docstring displayed when hovering over the panel module.\" width=\"2500\" height=\"1301\" data-wp-editing=\"1\" \/><\/a><\/p>\n<p>Common packages where you might observe this change in their docstrings include <code>pandas<\/code> and <code>scipy<\/code>. Try this change out, and report any issues or feedback at the <a href=\"https:\/\/github.com\/microsoft\/pylance-release\/\">Pylance GitHub repository<\/a>.<\/p>\n<blockquote><p>Note: This setting is currently experimental, but will likely be enabled by default in the future as it becomes more stabilized.<\/p><\/blockquote>\n<h2>Community contributed Pixi support<\/h2>\n<p>Thanks to <a href=\"https:\/\/github.com\/baszalmstra\">@baszalmstra<\/a>, there is now support for <a href=\"https:\/\/github.com\/prefix-dev\/pixi\">Pixi<\/a> 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.<\/p>\n<p>We appreciate and look forward to continued collaboration with community members on bug fixes and enhancements to improve the Python experience!<\/p>\n<h2>Other Changes and Enhancements<\/h2>\n<p>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:<\/p>\n<ul>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/python\/python-in-visual-studio-code-november-2023-release\/#improvements-to-shift-enter-run-line-in-terminal\">Smart Send<\/a> with <code>Shift+Enter<\/code> is now available in the <a href=\"https:\/\/devblogs.microsoft.com\/python\/python-in-visual-studio-code-june-2024-release\/#vs-code-native-repl-for-python-with-intellisense-and-syntax-highlighting\">VS Code Native REPL for Python<\/a> (<a href=\"https:\/\/github.com\/microsoft\/vscode-python\/pull\/23535\">@vscode-python23638<\/a>)<\/li>\n<li>Support <code>pytest<\/code> parameterized tests spanning multiple classes when calling the same setup function (<a href=\"https:\/\/github.com\/microsoft\/vscode-python\/pull\/23535\">@vscode-python#23535<\/a>)<\/li>\n<li>Bug fix to have load bar show during test discovery (<a href=\"https:\/\/github.com\/microsoft\/vscode-python\/pull\/23537\">@vscode-python#23537<\/a>)<\/li>\n<\/ul>\n<p>We would also like to extend special thanks to this month\u2019s contributors:<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/covracer\">@covracer<\/a> Restore execute bits on deactivate scripts in <a href=\"https:\/\/github.com\/microsoft\/vscode-python\/pull\/23620\">vscode-python#23620<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/nickwarters\">@nickwarters<\/a> Activate Python extension when <code>.venv<\/code> or <code>.conda<\/code> is found in the workspace in <a href=\"https:\/\/github.com\/microsoft\/vscode-python\/pull\/23642\">vscode-python#23642<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/baszalmstra\">@baszalmstra<\/a> Add locator for Pixi environments in <a href=\"https:\/\/github.com\/microsoft\/vscode-python\/pull\/22968\">vscode-python#22968<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/DetachHead\">@DetachHead<\/a> Add hook to <code>vscode-pytest<\/code> to determine number <code>xdist<\/code> workers to use based on count of selected tests in <a href=\"https:\/\/github.com\/microsoft\/vscode-python\/pull\/23539\">vscode-python#23539<\/a><\/li>\n<\/ul>\n<h2>Call for Community Feedback<\/h2>\n<p>As we are planning and prioritizing future work, we value your feedback! Below are a few issues we would love feedback on:<\/p>\n<ul>\n<li>Design proposal for test coverage in <a href=\"https:\/\/github.com\/microsoft\/vscode-python\/issues\/22827\">(@vscode-python#22827)<\/a><\/li>\n<\/ul>\n<p>Try out these new improvements by downloading the <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-python.python\">Python extension<\/a> and the <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-toolsai.jupyter\">Jupyter extension<\/a> from the Marketplace, or install them directly from the extensions view in Visual Studio Code (Ctrl + Shift + X or \u2318 + \u21e7 + X). You can learn more about <a href=\"https:\/\/code.visualstudio.com\/docs\/python\/python-tutorial\">Python support in Visual Studio Code<\/a> in the documentation. If you run into any problems or have suggestions, <a href=\"https:\/\/github.com\/microsoft\/vscode-python\/issues\/new\/choose\">please file an issue<\/a> on the <a href=\"https:\/\/github.com\/Microsoft\/vscode-python\">Python VS Code GitHub page<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The July 2024 release of the Python and Jupyter extensions for Visual Studio Code are now available. This month&#8217;s updates include a new tool for more performant environment discovery, improved support for reStructuredText docstrings, and community contributed Pixi support. Keep reading to learn more!<\/p>\n","protected":false},"author":99209,"featured_media":9763,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[17],"class_list":["post-9761","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-python"],"acf":[],"blog_post_summary":"<p>The July 2024 release of the Python and Jupyter extensions for Visual Studio Code are now available. This month&#8217;s updates include a new tool for more performant environment discovery, improved support for reStructuredText docstrings, and community contributed Pixi support. Keep reading to learn more!<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/posts\/9761","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/users\/99209"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/comments?post=9761"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/posts\/9761\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/media\/9763"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/media?parent=9761"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/categories?post=9761"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/tags?post=9761"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}