Today we announce the release of PyCharm 5.1 Beta, a feature-complete preview version of PyCharm 5.1.
Download PyCharm 5.1 Beta build 145.184.12 from the Early Access Preview page or as a patch-based update within the IDE (make sure to select the Beta releases or EAP channel in the update settings). After you take it for a spin, please give us your feedback.
Compared to the previous EAP build, this one includes a consolidation of fixes for various bugs and issues for recently added features, as well as a bunch of new features we hope you’ll enjoy:
Docker Compose support
Additionally to Docker container settings in run configurations (introduced in the previous EAP build), in PyCharm 5.1 Beta we introduce Docker Compose support. To get started with Docker Compose in PyCharm, make sure you’ve installed Docker Compose according to its official documentation. Then, check that the docker-compose executable is specified in PyCharm Settings | Build, Execution, Deployment | Docker:
Next, go to Settings | Project | Project Interpreter, click the gear icon to add a new remote interpreter. You’ll find the brand-new “Docker Compose” option there. All you need to do is just specify the Docker Compose configuration file (docker-compose.yml) and the service representing your project:
At this stage you can also change the Docker engine settings and the Python interpreter path in the container for your service. After that, click OK and PyCharm will configure the required services and Python interpreter. From this point, autocompletion, code inspections, and checks as well as other features will be driven by the interpreter from the Docker container derived from the service description in docker-compose.yml.
Note: Currently there’s a limitation: Docker Compose files v2 are not supported. We’ll fix it before the official release of PyCharm 5.1.
Optional type hinting using run-time collected types
In one of our previous EAP builds we introduced Python 2 and Python 3 Compatible Type Hinting support:
With this release we introduce the new experimental feature – generation of type annotations based on the run-time collected types. To use this feature, first enable run-time types collection: Go to Settings | Build, Execution, Deployment | Python Debugger. Enable “Collect run-time types information for code insight”. Next, run your application using the integrated PyCharm debugger. It will collect information about object types used in your code. After that, put the cursor to the function definition and hit Alt+Enter to get the list of the available code intentions:
Choose “Annotate types” and PyCharm will generate the type annotation based on the information on types it has collected during the debug session. This type information will be inserted in a format compatible with your project interpreter’s Python version:
Python code compatibility inspection improvements
Writing Python 2 and Python 3 compatible code is extremely important. PyCharm helps to ensure your code is compatible with particular Python versions. Whenever your code makes use of the __future__ or six modules, PyCharm now offers to enable the “Code compatibility inspection”. If you turn on this inspection, PyCharm enables it for latest Python 2.7 and Python 3.5 by default. To modify the inspection options you can go to Settings | Editor | Inspections and find “Code compatibility inspection” in the list of Python inspections:
From this point PyCharm will check the code compatibility against two or more Python versions specified.
Improved attach to process
The debugger’s attach to process feature got a small but useful improvement. We slightly changed its UI and added the “Recent” section for recently attached processes. To attach the PyCharm’s debugger to an already-running python process, go to Run | Attach to Local Process:
Here’s a recap of what’s new coming in PyCharm 5.1:
- Docker Compose support
- Docker container settings in run configurations
- Tox support
- Improved support for Django forms
- Stepping filters in debugger
- Stepping over yield from and await
- Debugger performance improvements
- Python 2 and Python 3 Compatible Type Hinting
- Optional type hinting using run-time collected types
- Python code compatibility inspection improvements
- Devpi and Optional PyPI repositories support
- Postfix Code Completion
- Folding for Python code blocks, collection literals, and multi-line comments
- Improved attach to process
- Improved rendering of Markdown, LaTeX, and HTML cells in IPython Notebook files
- Local Terminal Improvements
- Support for RTL languages (Arabic and Hebrew).
- Easier merging with Git and other VCS thanks to the added by-word difference highlighting.
- Two new actions to help you work with Git branches, available via the Branches popup (VCS | Git | Branches): Checkout with Rebase and Rename.
- Git worktree support and updated look and feel of Git Log.
- Improved speed-search in the show usages popup (Ctrl(Cmd)+Alt+7).
- and more…
Web development improvements:
- Unused imports warning and сode folding for ES6 imports
- Remote run and debug for Node.js apps
- Css custom properties
- Code assistance in tsconfig.json, .babelrc and .eslintrc
- Inline rename for TypeScript
- Debugging JS async code
- Improved support for React, Angular 1.5 and 2
- npm support improvements and Webpack support
- and more…
For more details about the upcoming features please see the announcements of the previous EAP builds.
Stay tuned for a PyCharm 5.1 release announcement, follow us on twitter, and develop with pleasure!
JetBrains PyCharm Team