{"id":9423,"date":"2023-08-03T14:37:25","date_gmt":"2023-08-03T22:37:25","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/python\/?p=9423"},"modified":"2023-08-17T09:18:08","modified_gmt":"2023-08-17T17:18:08","slug":"python-in-visual-studio-code-august-2023-release","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/python\/python-in-visual-studio-code-august-2023-release\/","title":{"rendered":"Python in Visual Studio Code &#8211; August 2023 Release"},"content":{"rendered":"<p>We\u2019re excited to announce the August 2023 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>Python extension Dev Container for Contributors<\/li>\n<li>Debug configuration for running Python files with arguments<\/li>\n<li>Npm package for the Python extension API<\/li>\n<li>Error-tolerant pytest discovery<\/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:\/\/github.com\/microsoft\/vscode-jupyter\/blob\/main\/CHANGELOG.md\">Jupyter<\/a> and <a href=\"https:\/\/github.com\/microsoft\/pylance-release\/blob\/main\/CHANGELOG.md\">Pylance<\/a> extensions.<\/p>\n<h2>Python extension Dev Container for Contributors<\/h2>\n<p>There is now a <a href=\"https:\/\/code.visualstudio.com\/docs\/devcontainers\/containers\">Dev Container<\/a> in the <a href=\"https:\/\/github.com\/microsoft\/vscode-python\">source repo of the Python extension<\/a>. Using this customized dev container, contributors can open the Python extension repository in <a href=\"https:\/\/github.com\/features\/codespaces\">GitHub Codespaces<\/a>, and start working on developing and testing the Python extension with no other installation required. Since we&#8217;ve enabled <a href=\"https:\/\/docs.github.com\/en\/codespaces\/prebuilding-your-codespaces\/about-github-codespaces-prebuilds\">pre-builds<\/a>, the Dev Container will load instantly.<\/p>\n<p>Python versions 3.7, 3.8, 3.9, 3.10, and 3.11 are pre-installed so you can readily switch between Python versions using pyenv. The dev container is also configured to install any required extensions for development, including <a href=\"https:\/\/github.com\/microsoft\/pylance-release\">Pylance<\/a> and <a href=\"https:\/\/github.com\/microsoft\/vscode-black-formatter\">Black formatter<\/a> extensions.<\/p>\n<h2>Debugger configuration for running files with arguments<\/h2>\n<p>The new <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-python.debugpy\">Debugpy extension<\/a> now provides a <strong>&#8220;Python File with Arguments&#8221;<\/strong> <code>launch.json<\/code> configuration, which is useful when you want to provide different input values for your Python file without the need to modify your code or the debugger configuration each time you run it.<\/p>\n<p>To use this configuration, make sure you have the <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-python.debugpy\">Debugpy extension<\/a> installed. Then open the Run and Debug view by pressing <code>Ctrl + Shift + D<\/code> or <code>\u2318 + \u21e7 + D<\/code> and click on either <strong>Create a launch.json file<\/strong> or the gear icon to access the <code>launch.json<\/code> file. Select <strong>Debugpy<\/strong>, and then select <strong>Python: File with Arguments<\/strong> from the available configurations.<\/p>\n<p>Then, open the Python file that you want to debug, which requires command-line arguments. To start debugging, press <code>F5<\/code>, or <strong>Run &gt; Start Debugging<\/strong>. A prompt will appear, allowing you to enter the desired arguments that should be passed to the Python file.<\/p>\n<p>After entering your arguments, press Enter, and the debugger will start, letting you step through your code!<\/p>\n<p><div style=\"width: 2762px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-9423-1\" width=\"2762\" height=\"1750\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2023\/08\/debugpy-args-prompt.mp4?_=1\" \/><a href=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2023\/08\/debugpy-args-prompt.mp4\">https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2023\/08\/debugpy-args-prompt.mp4<\/a><\/video><\/div><\/p>\n<p><em>Theme:\u00a0<a class=\"external-link\" href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=Catppuccin.catppuccin-vsc\" target=\"_blank\" rel=\"noopener\">Catppuccin Macchiato<\/a>\u00a0(preview on\u00a0<a class=\"external-link\" href=\"https:\/\/vscode.dev\/theme\/Catppuccin.catppuccin-vsc\/Catppuccin%20Macchiato\" target=\"_blank\" rel=\"noopener\">vscode.dev<\/a>)<\/em><\/p>\n<h2>Npm package for the Python extension API<\/h2>\n<p>The <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-python.python\">Python<\/a> extension now provides an npm package to make it easier for other extension authors to access and track changes in the Python extension API. Check out the <a href=\"https:\/\/www.npmjs.com\/package\/@vscode\/python-extension\">@vscode\/python-extension<\/a> npm module to work with Python environments available on your machine.<\/p>\n<h2>Error-tolerant pytest discovery<\/h2>\n<p>The Test Explorer panel now supports error-tolerant pytest discovery as a feature included in our <a href=\"https:\/\/devblogs.microsoft.com\/python\/python-in-visual-studio-code-june-2023-release\/#test-discovery-and-execution-rewrite\">new testing architecture<\/a>. If pytest encounters a manageable error during discovery, such as an unknown import, all remaining tests will still be discovered outside the file containing the error. This feature is only available on the new testing rewrite behind an experimental feature. The rewrite is currently active for 100% of pre-release users and 25% of release users, but will be rolled out universally in the near future. In the meantime, you can continue to opt in or out of the rewrite with the <code>pythonTestAdapter<\/code> setting.<\/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>Import resolution errors show more information about the environment in use (<a href=\"https:\/\/github.com\/microsoft\/pylance-release\/issues\/4368\">@pylance-release#4368<\/a>).<\/li>\n<li>Removal of the <strong>Create Environment<\/strong> button in dependency files will be rolled out to 100% of users based on feedback (<a href=\"https:\/\/github.com\/microsoft\/vscode-python\/issues\/20982\">@vscode-python#20982<\/a>).<\/li>\n<li><strong>Run file in dedicated terminal<\/strong> re-added as a run configuration (<a href=\"https:\/\/github.com\/microsoft\/vscode-python\/issues\/21282\">@vscode-python#21282<\/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\/lmgarret\">@Imgarret<\/a> helped file issues and created test cases for test classes, erroring, and skip flags for pytest related to the new testing rewrite (<a href=\"https:\/\/github.com\/microsoft\/vscode-python\/issues\/21578\">@vscode-python#21578<\/a> and <a href=\"https:\/\/github.com\/microsoft\/vscode-python\/issues\/21579\">@vscode-python#21579<\/a>).<\/li>\n<li><a class=\"user-mention notranslate\" href=\"https:\/\/github.com\/Jammf\" data-hovercard-type=\"user\" data-hovercard-url=\"\/users\/Jammf\/hovercard\" data-octo-click=\"hovercard-link-click\" data-octo-dimensions=\"link_type:self\">@Jammf<\/a> made their first contribution to vscode-mypy to fix errors when using &#8211;follow-imports=normal (<a class=\"issue-link js-issue-link\" href=\"https:\/\/github.com\/microsoft\/vscode-mypy\/pull\/76\" data-error-text=\"Failed to load title\" data-id=\"1788631308\" data-permission-text=\"Title is private\" data-url=\"https:\/\/github.com\/microsoft\/vscode-mypy\/issues\/76\" data-hovercard-type=\"pull_request\" data-hovercard-url=\"\/microsoft\/vscode-mypy\/pull\/76\/hovercard\">@vscode-mypy#76<\/a>).<\/li>\n<li><a class=\"user-mention notranslate\" href=\"https:\/\/github.com\/PeterJCLaw\" data-hovercard-type=\"user\" data-hovercard-url=\"\/users\/PeterJCLaw\/hovercard\" data-octo-click=\"hovercard-link-click\" data-octo-dimensions=\"link_type:self\">@PeterJCLaw<\/a> made their first contribution to vscode-mypy to remove follow-imports argument which may conflict with projects (<a class=\"issue-link js-issue-link\" href=\"https:\/\/github.com\/microsoft\/vscode-mypy\/pull\/90\" data-error-text=\"Failed to load title\" data-id=\"1808537150\" data-permission-text=\"Title is private\" data-url=\"https:\/\/github.com\/microsoft\/vscode-mypy\/issues\/90\" data-hovercard-type=\"pull_request\" data-hovercard-url=\"\/microsoft\/vscode-mypy\/pull\/90\/hovercard\">@vscode-mypy#90<\/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>Support viewings for numpy and pickle files natively by double-clicking on them: <a href=\"https:\/\/github.com\/microsoft\/vscode-python\/issues\/21443\">@vscode-python#21443<\/a><\/li>\n<li>Add support for installing <code>requirements.txt<\/code> on current virtual environment by right-clicking on the file: <a href=\"https:\/\/github.com\/microsoft\/vscode-python\/issues\/21555\">@vscode-python#21555<\/a><\/li>\n<li>Dynamic module path in <code>launch.json<\/code> config: <a href=\"https:\/\/github.com\/microsoft\/vscode-python\/issues\/21449\">@vscode-python#21449<\/a><\/li>\n<\/ul>\n<p>Additionally, as a reminder, issues with the <a href=\"https:\/\/github.com\/microsoft\/vscode-python\/issues?q=is%3Aopen+is%3Aissue+label%3Afeature-request\"><code>feature-request<\/code> label<\/a> require 7 \ud83d\udc4d upvotes within 60 days of opening to issue to gauge community interest. We use this as another way to prioritize upcoming work.<\/p>\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 (<code>Ctrl + Shift + X<\/code> or <code>\u2318 + \u21e7 + X<\/code>). 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 August 2023 release of the Python and Jupyter extensions for Visual Studio Code are now available. This month&#8217;s updates include a pre-configured dev container for the Python extension, a new debug configuration, an npm package for the Python extension API, and error-tolerant pytest discovery with the testing rewrite. Keep reading to learn more!<\/p>\n","protected":false},"author":99209,"featured_media":10119,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1,6],"tags":[17],"class_list":["post-9423","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","category-visual-studio-code","tag-python"],"acf":[],"blog_post_summary":"<p>The August 2023 release of the Python and Jupyter extensions for Visual Studio Code are now available. This month&#8217;s updates include a pre-configured dev container for the Python extension, a new debug configuration, an npm package for the Python extension API, and error-tolerant pytest discovery with the testing rewrite. Keep reading to learn more!<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/posts\/9423","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=9423"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/posts\/9423\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/media\/10119"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/media?parent=9423"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/categories?post=9423"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/tags?post=9423"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}