PyCharm 2021.2 EAP Has Started!
Time to try new features and weight in with your active feedback!
We are opening a new cycle of the Early Access Program for those of you eager to try, discuss, and maybe even contribute to new PyCharm features before they’re commonly used by the Python community.
As usual, our main goal for the EAP is to give you a sense of what to expect in the upcoming PyCharm 2021.2 release. We are hoping to get your active feedback on the overall performance of the PyCharm 2021.2 EAP versions, and in particular, on the feel, look, and performance of the new features we will be highlighting throughout the EAP blog posts.
You can do this on Twitter (mentioning @pycharm), or on our issue tracker.
Important! PyCharm EAP builds are not fully tested and might be unstable.
The Toolbox App is the easiest way to get the EAP builds and keep both your stable and EAP versions up to date. You can also manually download the EAP builds from our website.
Python 3.10
This May, the PSF launched the Python 3.10.0 beta 1, which means that at this point no new features will be accepted for the final release of Python 3.10. For PyCharm during this release, we are starting to implement support for the new PEPs included in Python 3.10, so that by the time Python 3.10 is officially out, you will be able to enjoy the new language features in full. Now is a good time to start investigating how you can benefit from the new Python functionality – start exploring with PyCharm!
In this release we added initial support for Pattern Matching. PyCharm is now equipped with syntax highlighting for this complex language structure.
Stay with us for updates on PyCharm’s support for the new PEPs!
Pytest
PyCharm now allows you to swap actual/expected values in pytest assertion failure messages if the default order doesn’t fit your project conventions.
By default, PyCharm provides the expected == actual assertion. To change the order of the assertion parameters, press ⌘,
to open IDE settings and select Advanced Settings, then select the Swap the order of actual and expected assertions in Pytest checkbox in the Python section. Check out what else PyCharm has for testing with pytest in our Help.
Doctest in Markdown
If you are using fenced code blocks in your Markdown files, you probably know that PyCharm can enable syntax highlighting, code completion, inspections, and intention actions if you specify the language for the code block.
Now you can use the doctest
injection in Markdown to demonstrate the execution of Python code in REPL mode (as if it were being executed in the Python console). This is particularly useful for checking whether your documentation is up to date and corresponds to your code, and whether your tests work correctly.
SSH: IPv6-only hosts and switching deployment configurations
When you create or change an SSH interpreter, you might need to synchronize local content with the target server. PyCharm 2021.2 now suggests synchronizing files when you switch a project’s remote interpreter. Remote interpreter deployments for the same machine no longer clash with each other in the same project. Adding a remote interpreter on an IPv6-only host no longer requires a workaround. You can learn more about configuring and using remote interpreters via SSH in PyCharm Help.
Frontend development
Browser pages reload on save
In the previous release, we made it possible to preview HTML files in a browser using the built-in web server. Now, it can also automatically reload the page opened in a browser in accordance with the changes you make to the corresponding HTML file or the linked CSS and JavaScript files. Reloading is triggered whenever changes are saved in the IDE, either automatically or using ⌘S / Ctrl+S, or when changes are made to a file externally.
To try this new feature, open an HTML file, hover over the code, and click on the icon for the browser you want to use – all browsers are supported. You can also preview the file in a browser by going to View | Open in Browser in the main menu.
Reloading on save is turned on by default. To tweak the settings for it or to turn it off, go to the Built-in Server section in Preferences / Settings | Build, Execution, Deployment | Debugger When you use the feature for the first time, you’ll also see a popup with a link to the same settings.
The new feature may sound similar to the Live Edit feature PyCharm has had for some time already. You can, and may still need, to use Live Edit if you want to see changes when you can’t open the page on the built-in IDE server. With the new feature, we wanted to provide a more straightforward experience and make the reloading process more predictable and available in all browsers.
Please give this feature a try and let us know what you think.
New action for adding arrow functions
We added a new live template to help you add arrow functions faster. You can use it to surround a block of code with an arrow function using ⌥⌘J / Ctrl+Alt+J. You can also type arf and press ⇥ / Tab to expand the template and add an empty arrow function, as shown below.
User Experience
Advanced Settings
We have good news for those who need to configure PyCharm to address particular needs. We’ve added a new node to Preferences | Settings – Advanced Settings. It contains some use-case specific options conveniently grouped by IDE tool. Most of the settings have been transferred from the Registry, though some of them are new.
They weren’t used often but were still helpful for some users, so we wanted to make those options easier to access. You’ll also find some new configuration options there, such as the ability to set a left margin in Distraction-free mode, or set the caret to move down after you use the Comment with Line Comment action.
In the future, we also plan to move some of the options that are currently available under the regular settings to this new node.
New navigation option in Preferences/Settings
Starting from this EAP, it is possible to navigate back and forth between open sections in Preferences/Settings. To do so, use the arrows in the right-hand corner of the window.
Automatic cache and logs cleanup
After each major update, your IDE will automatically clean up any cache and log directories that were last updated more than 180 days ago. During this process, the system settings and plugin directories stay intact.
You can also trigger this process manually using the Help | Delete Leftover IDE Directories… action.
Default directory locations are described in this article.
Multiple copyright years
This EAP version introduces support for including both the project creation year and the current version year in a project’s copyright notice. When you add a new copyright profile, you will see a template including both dates. Please refer to the originalComment variable when you need to access an existing copyright notice.
Accessibility updates
It’s now easier to code with the enabled screen reader mode on macOS – a list of available suggestions for code completion is now read out loud. We’ve also voiced the content of the selected combo box as well as the combo box lists.
What’s more, you can effortlessly use the Search Everywhere action because the results of the search are now properly pronounced. The number of sounded help tooltips was reduced to keep you undisturbed.
VCS
Unified Show Diff
Starting from v2021.2, PyCharm will display the difference between the initial and changed files in the editor. It doesn’t matter how you invoke the Show Diff action – via a shortcut, icon, from the context menu, from Log or File History, or by clicking on a file in the Commit view – the IDE will open the diff in the editor by default.
If you find it more convenient to track changes in a separate window, you can drag the desired file from the editor. If you do, the IDE will remember this and will open future diffs in a separate window.
To go back to the default display, click the gear icon and select Show Diff in Editor Tab.
Collaborative development
Code WIth Me, a bundled plugin for collaborative development, now supports working in Python Console on a client machine as well as on the host side.
Notable bug fixes:
- VCS: PyCharm uses a project’s interpreter instead of the system one while git hooks are used. [PY-12988]
- TypeChecker: type hinting for callback protocols is now supported. [PY-45438]
- Type hinting: the bundled Typeshed is now being overwritten correctly, and unexpected warnings no longer appear. [PY-39762]
- Scientific view: timezone information for Pandas DataFrame is now displayed correctly. [PY-42673]
Ready to join the EAP?
Some ground rules
- EAP builds are free to use and expire 30 days after the build date.
- You can install an EAP build side by side with your stable PyCharm version.
- These builds are not fully tested and can be unstable.
- Your feedback is always welcome. Please use our issue tracker and make sure to mention your build version
How to download
Download this EAP from our website. Alternatively, you can use the JetBrains Toolbox App to stay up to date throughout the entire EAP. If you’re on Ubuntu 16.04 or later, you can use snap to get PyCharm EAP and stay up to date.
The PyCharm team