PyCharm 5.1 EAP 145.61.29: Django forms, debugger stepping filters, Docker and IPython notebook improvements

Today we continue the weekly delivery of PyCharm 5.1 preview builds with the PyCharm 5.1 EAP build 145.61.29.
Download and try it today.

Let’s look at the set of valuable improvements introduced in this build.

Improved support for Django forms

Forms is one of the core concepts of the Django framework. In PyCharm 5.1 EAP we implemented advanced support for Django forms. PyCharm now understands the forms context and shows forms-specific autocompletion and suggestions in Django templates and views. For example here PyCharm suggests keys for the cleaned_data attribute:

forms1

PyCharm also infers types of the cleaned_data members:

forms2

Understanding the forms context doesn’t end with just autocompletion. You can find all usages of a form or a field in the project; refactor form or form members with Rename and other refactorings; and navigate to form definitions from templates and views with Ctrl+Click:

form3

PyCharm recognizes formsets and types of forms when iterating over a formset:

forms4

Besides simple forms and formsets, PyCharm also recognizes Django forms built upon Django models. For example here is the result of Find Usages (Alt+F7) for the “proclamation” field:

forms5

Stepping filters in debugger

Additionally to the stepping over yield from and await expressions introduced in the first PyCharm 5.1 EAP, this build adds another debugger improvement: stepping filters. By using stepping filters for Python code, you can exclude library and custom modules from stepping into during a debugging session.

To use this feature, go to Settings (Preferences for Mac users) | Build, Execution, Deployment | Debugger | Stepping. Mark the check-boxes to exclude library scripts and/or project modules from stepping into, by using the glob pattern:

stepping

Docker container settings in run configurations

In PyCharm 5.1 EAP we’ve improved Docker support with the custom parameters for running docker containers. To get started with Docker in PyCharm, read the Using Docker in PyCharm article. Once you’ve set up the remote docker interpreter, you may notice a new option in the run configuration (Run | Edit Configurations):

docker1

In the pop up dialog you can specify a different option for the container:

docker2

We believe this is a big addition for most of you and we worked hard to bring it in this EAP.

Improved rendering of Markdown, LaTeX, and HTML cells in IPython Notebook files

Thanks to the new rendering mechanism for IPython Notebook cells, PyCharm 5.1 EAP displays cells with Markdown, LaTeX and HTML content the way better than before:

ipython

In addition to the rendering improvements, PyCharm 5.1 introduces a new action to run all cells in the Notebook. Simply press Shift+F10 to run all cells in an .ipynb file.

The full list of changes from the previous EAP build is available in the Release notes.

Please take PyCharm 5.1 EAP build 145.61.29 for a spin! Should you encounter any problems, please report them to our public tracker.

You can download the build or use the patch-based upgrade to upgrade from within the IDE (from the previous PyCharm 5.1 EAP builds only) without a full re-installation. Just make sure you’ve selected the EAP channel in update settings.

Read about the features and improvements added in previous PyCharm 5.1 EAP builds:

  • PyCharm 5.1 EAP 144.4199.7: Python 2/3 compatible type hinting, Postfix completion, Terminal improvements
  • PyCharm 5.1 EAP 144.3891.17: Tox support, Devpi and Optional PyPI repositories support, Folding for Python code blocks, collection literals, and multi-line comments, Stepping over yield from and await, Debugger performance improvements.

PyCharm Team
The Drive to Develop

Posted in Early Access Preview | 3 Comments

PyCharm 5.1 EAP 144.4199.7: Python 2/3 compatible type hinting, Postfix Completion, Terminal Improvements

A week ago we announced the first PyCharm 5.1 EAP build with lots of new neat features and improvements such as Tox support, Optional PyPI repositories, Debugger performance improvements and more. Today we continue the weekly delivery of PyCharm 5.1 preview builds with the PyCharm 5.1 EAP build 144.4199.7.
Download and try it today!

Let’s look at the set of valuable improvements introduced in this build.

Python 2 and Python 3 Compatible Type Hinting

With its release half a year ago, Python 3.5 introduced type hinting to help code-writing during development. The standard that brings optional type hinting to Python is PEP 484. PyCharm fully supported this standard with the PyCharm 5 release along with the full support for other new Python 3.5 standards.

Recently an addition to PEP 484 has been proposed to make type hinting possible in Python 2/3 compatible code. The addition has been accepted and can be found in PEP 484 | Suggested syntax for Python 2.7 and straddling code. With PyCharm 5.1 we bring support for this valuable addition for both Python 2 and 3:

python27

Please read this comprehensive blog post on Python 3.5 type hinting in PyCharm 5 to get a better idea of what type hinting is in Python and why it’s important.

Postfix Code Completion

Postfix code completion helps reduce backward caret jumps as you write code. It lets you transform an already typed expression to another one based on the postfix you’ve added and the context of the expression. For example, the “.if” postfix applied to an expression wraps it with an if statement. Likewise the “.ifnn” triggers a surround template checking the expression for the not None value:

postfix

To see all the postfix templates and change their settings (for example, to disable the templates you don’t need), go to Settings → Editor → General → Postfix Templates.

Local Terminal Improvements

Embedded local terminal now supports “Find in text”. Hit Ctrl+F in the terminal and start searching in the terminal output:

terminal

Additionally the terminal now supports double-width unicode characters and is now capable of performing Alt+Backspace for deleting symbols to the left of caret position and Ctrl+Left/Right to move caret to the left or right of the current word.

The full list of changes comparing to the previous EAP build is available in the Release notes.

Please take PyCharm 5.1 EAP build 144.4199.7 for a spin! Should you encounter any problems, please report them to our public tracker.

You can download the build or use the patch-based upgrade to upgrade from within the IDE (from the previous PyCharm 5.1 EAP build only) without a full re-installation. Just make sure you’ve selected the EAP channel in update settings.

PyCharm Team
The Drive to Develop

Posted in Cool Feature, Early Access Preview | 16 Comments

Faster debugger in PyCharm 5.1

The first EAP for PyCharm 5.1 was released last week, with lots of enticing features. Here’s one that jumps out for long-time users: “Debugger performance improvements”. Let’s take a look at this in a little more depth, then provide some of the back story.

Imagine we’re debugging a semi-large code base with PyCharm 5.0.4. If we set a breakpoint and time how long it takes to get there, it measures out as 12 seconds:

debugger_speedup 5.1 pre

In PyCharm 5.1, the debugger performance has improved, especially for large code bases. Let’s give the same scenario a try:

debugger_speedup

Almost 3.5 seconds of improvement on OS X.

Wouldn’t it be great to get a couple more seconds? And now comes the real story: the new debugger has some performance improvements implemented in Cython. On OS X and Linux we need to install them manually, as the debugger console message helpfully tells us:

debugger_speedup 5.1 screenshot

Windows users get these Python speedups pre-bundled. Let’s install them on OS X by copying the text above after “Debugger speedups using Cython not found. Run…”:

debugger_speedup 5.1 install

That is, we’re running:

…using the Python in this project’s virtual environment, just to make sure we have the correct Python version. Once more, let’s measure the time to get to the breakpoint:

debugger_speedup 5.1 post

5.7 seconds! That’s a meaningful difference. As stated by the developers, the debugger is 40% faster in the general case and over 130% faster when you have the Cython modules compiled and installed. Again, if you are on Windows, you don’t need to do anything — you will get these improvements automatically for Python 2.7, Python 3.4, and Python 3.5 interpreters.

On OS X and Linux, you need to do a one-time compilation using any Python on your system matching the Python version you need, as shown in the screenshot above. For example, if you use Python 2.7 and Python 3.4, you need to run the Cython speedups with an interpreter matching those two versions. Each time you run it, a compiled speedup will be saved in your PyCharm application, for that Python version. For example, on my system, this was created:

Note the “-2.7” in the directory name. Also, note that you don’t have to do this with your virtual environment’s Python, but it certainly makes sense to do so, as you’ll be sure to match the version. You don’t have to do this once for every Python 2.7 virtual environment, as these speedups aren’t stored in the virtual environment. They are stored inside PyCharm’s pydevd helper.

Now, on to the backstory. As explained in the blog post announcing the 5.1 EAP, JetBrains joined efforts with PyDev, helping sponsor the work on pydevd which is shared by the two projects. Both projects require a sophisticated debugger backend and previously merged their work. This performance improvement is another step forward in the collaboration.
If you debug a large code base, give this EAP a try with the Cython speedups and post a comment letting us know your results. We expect performance improvements to be higher for larger code bases.

PyCharm Team
The Drive to Develop

Posted in Uncategorized | 2 Comments

PyCharm 5.1 EAP is Open

Today we’re extremely glad to announce that the first PyCharm 5.1 Early Access Preview (EAP) build 144.3891.17 is finally available for download! Head on over to the PyCharm Early Access Preview (EAP) page and have a look at the download section where you can get it for your platform right now.

What is the Early Access Program (EAP)?
We at JetBrains believe that making tools for developers should greatly involve listening to developers. Early Access Programs allow you to try pre-release versions of our software to evaluate features that will be added to the next release, closely participate in discussions about PyCharm, and influence the release from early stages onwards.

Once you’ve downloaded the latest EAP build (from its official page), you’ll start getting updates with new features and improvements every week (to receive notifications about updates, make sure to set “Early Access Program” in your update settings). Your feedback is welcome and very much appreciated in our issue tracker or in the comments section of this blog post.

PyCharm 5.1 EAP build # 144.3891.17 introduces a lot of new features, bug-fixes and improvements. There are a number of recently added features that are unique to PyCharm, as well as additional features and improvements from the Web and IntelliJ Platform sides.

Python Related Improvements

Tox support

We’re pleased to announce that PyCharm 5.1 EAP now supports Tox, the virtualenv management and testing tool. Simply right-click the tox.ini file in the project view and choose Run “Tox” or press Ctrl (Cmd) + Shift + F10. See the tests running and results nicely represented in the graphical test runner:

Tox

Devpi and Optional PyPI repositories support

Take full control over package repositories and PyPI mirroring solutions with support for optional repositories in PyCharm. To specify a custom repository (including devpi repos):

  1. Go to Settings (Preferences) | Project | Project Interpreter and click the “+” icon:

devpi1

2. In the Available Packages dialog box, click “Manage Repositories”.
3. In the Manage Repositories dialog box, add, delete or edit the URLs of any repositories:

devpi2

Folding for Python code blocks, collection literals, and multi-line comments

In addition to the existing code folding functionality in PyCharm’s code editor, we’ve implemented code folding for other code structure elements such as multi-line dictionaries, lists and comments, and if-else, for/while and try-except-finally code blocks in case a code block contains more than one statement:

folding

You can find additional options in Settings (Preferences) | Editor | General | Code folding (“Long string literals”, “Long collection literals”, “Sequential comments”). Read more about code folding options in PyCharm help.

Stepping over yield from and await

A small but neat improvement for developers who use Python 3, PyCharm’s debugger is now able to step over yield from and await expressions. Put a breakpoint before a yield from or an await expression and press the Step over button (F8). The debugger will step to the next line after the expression:

yieldfrom

Debugger performance improvements

In addition to stepping over yield from and await expressions as described above, PyCharm’s debugger receives a number of performance improvements that we hope you’ll enjoy. One year before we released PyCharm 4, we joined efforts with Fabio Zadrozny, a PyDev maintainer, and merged our debugger code with that from the original PyDev repository. Now the work on the debugger continues from both sides (PyCharm and PyDev) in one place. As a result of the unification and the work done since then, the debugger in PyCharm has grown more powerful.

The very recent improvement that you can now see in PyCharm 5.1 EAP is that the debugger became much faster and now has optional Cython modules for even additional speedups. The debugger is reported to be now overall 40% faster without Cython and 138% faster with Cython in the benchmarks created. In real world cases, even better gains are expected as the benchmarks were done for the cases where the debugger has more overhead than usual. You can read more about the performance improvements and see some detailed benchmark statistics in the original blog post written by Fabio.

Web Development Improvements

As usual, PyCharm 5.1 will have all features of the upcoming WebStorm 12 release. WebStorm 12 preview builds are already available (read more in the WebStorm blog), so here is just a short summary of what’s new and available in the PyCharm 5.1 preview build 144.3891.17 from the Web side:

  • Better coding assistance for JavaScript, ECMAScript and TypeScript
  • Unused imports warning and сode folding for ES6 imports
  • Remote run and debug for Node.js apps
  • 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…

Some of these features are already bundled with PyCharm 5.1 EAP, while others are available for installation from the JetBrains plugin repository.

Platform Improvements

In addition to the new features and improvements from the Web side, PyCharm 5.1 receives a lot of changes from the underlying IntelliJ Platform. The most noteworthy changes include:

  • 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).

PyCharm 5.1 runs on Java 8

Another important announcement is that the whole IntelliJ Platform has migrated to Java 8. That means that now you can not launch PyCharm under a JDK older than Java 8. This change affects all the EAP builds (144.*) and further major releases this upcoming spring.

Download PyCharm 5.1 preview build 144.3891.17 for your platform right from the project EAP page, and please report any bugs and feature request to our Issue Tracker.

Note: The PyCharm 5.1 preview build is available in two editions – free/open source PyCharm Community Edition and full-fledged PyCharm Professional Edition. While both of them are available for download and use at no charge, PyCharm Professional Edition has a 30-day time-limited evaluation period.

PyCharm Team
The Drive to Develop

Posted in Cool Feature, Early Access Preview | 9 Comments

[Webinar Recording] Polyglot PyCharm for Rich Web Front-ends Part 2

The recording of our February 4th webinar,
Polyglot PyCharm for Rich Web Front-ends Part 2, is now available on JetBrains YouTube Channel.

We put a lot of work into this part 2. Based on feedback on the first part, we created over 10 articles with explanations and code samples for the topics covered in the webinar. For Python developers interested in modern frontends, this webinar and material are very valuable resources: http://www.pauleveritt.org/articles/pylyglot/

Polyglot PyCharm for Rich Web Front-ends Part 2
In this second installment of Polyglot Python with PyCharm, we go further in showing PyCharm driving modern web frontend development, and how JavaScript can be used Pythonically. This session builds on the basics introduced earlier and goes deeper into new ways to develop for the browser.

The list of topics with timing:
00:40 Overview of background material
04:02 Bundling ToDoMVC with Webpack
22:52  ES6 Imports with Babel
38:39 Pythonic JavaScript
59:29 Test-Driven Development for JavaScript

Keep up with the latest PyCharm news on our blog and follow us on Twitter @PyCharm.

The Drive to Develop
– PyCharm team

Posted in Cool Feature, Screencast, Webinar | Leave a comment

PyCharm 5.0.4 update released

PyCharm 5.0.4 has been uploaded and is now available from the download page.

It also will be available soon as a patch update from within the IDE (from PyCharm 5.0.x only).

The Release Notes lists all fixes for this update.

As a recap, this minor bug update delivers the following fixes and improvements:

  • several fixes for Python 3.5 support
  • a number of fixes and small improvements for Python debugger
  • a number of fixes for SQL injections in Python code
  • a number of fixes and improvements for code insight and inspections
  • Django support fixes
  • fixes for Python formatter
  • a fix for code coverage and Python profiler
  • a bunch of platform improvements in different subsystems

Download PyСharm 5.0.4 for your platform from our website and please report any problem you found in the Issue Tracker.

If you would like to discuss your experiences with PyCharm, we look forward to your feedback in comments to this post and on twitter.

The Drive to Develop
PyCharm team

Posted in Release Announcements | Leave a comment

[Live Webinar] Polyglot PyCharm for Rich Web Front-ends Part 2, February 4

Join us Thursday, February 4, 15:00 – 16:00 GMT (10:00 AM – 11:00 AM EST) for our free live webinar, Polyglot PyCharm for Rich Web Front-ends featuring Paul Everitt.

pycharm_webinar_Polyglot_PyCharm_for_Rich_Web_Front-ends_part_2

Polyglot PyCharm for Rich Web Front-ends Part 2

Recently we published the recording of our Polyglot PyCharm for Rich Web Front-ends webinar. The webinar was a huge success and we’ve got a lot of positive feedback in the after-webinar survey.

In this second installment of Polyglot Python with PyCharm, we go further in showing PyCharm driving modern web frontend development, and how JavaScript can be used Pythonically. This session builds on the basics introduced earlier and goes deeper into new ways to develop for the browser.
Topics covered include:

  • Debugging a browser from within PyCharm
  • Test-driven development with Mocha
  • Pythonic JavaScript using Babel for ES6
  • Bundling for the browser target using Webpack

To make this webinar more effective, registrants will receive in advance the materials demonstrated.

About Paul Everitt
Paul Everitt is the PyCharm Developer Evangelist at JetBrains and a partner with Chris McDonough and Tres Seaver at Agendaless Consulting. Before that, Paul was a co-founder with Zope Corporation, taking the first open source application server through $14M of funding. Paul has bootstrapped both the PSF and the Python Software Foundation. Before that, Paul was an officer in the US Navy, starting www.navy.mil in 1993.

Space is limited, so please register now. There will be an opportunity to ask questions during the webinar. A video recording will be made available a few days later.

Keep up with the latest PyCharm news on our blog and follow us on Twitter @PyCharm.

The Drive to Develop
PyCharm team

Posted in Tutorial, Webinar | Leave a comment

PyCharm 5.0.4 EAP is Available

Today we announce the early preview build of PyCharm 5.0.4 #143.1919.1. The list of bug fixes and improvements for this build can be found in the release notes.

It’s been a while since the previous release of PyCharm 5.0.3, so PyCharm 5.0.4 EAP build 143.1919.1 consolidates a lot of fixes and improvements. Some highlights are:

  • several fixes for Python 3.5 support
  • a number of fixes and small improvements for Python debugger
  • a number of fixes for SQL injections in Python code
  • a number of fixes and improvements for code insight
  • Django support fixes
  • fixes for Python formatter
  • a fix for code coverage and Python profiler
  • and much more

See the full list of improvements in the release notes. Patch update from the previous PyCharm releases should by available shortly.

Please give PyCharm 5.0.4 EAP a try before its official release and please report any bugs and feature request to our issue tracker.

Drive to develop
-PyCharm team

Posted in Early Access Preview | 16 Comments

Introducing Getting Started with PyCharm video tutorials

Many of our users have been asking us to create a set of video tutorials covering PyCharm functionality and features. Today we’re happy to announce the very first Getting Started with PyCharm series of nine short video tutorials, covering the most essential things every PyCharm user should know first. This series is produced by Paul Everitt, PyCharm Developer Advocate at JetBrains:

The Getting Started with PyCharm playlist is available on the JetBrains Youtube Channel and soon will be available on the PyCharm website. During this short video course you’ll learn the most important features and concepts, starting from PyCharm setup and initial configuration, through creating, running and debugging your projects to productive coding tips, refactorings, testing, efficient navigation and customizing the IDE to meet your needs. The structure of the course is the following:

0. Quick Tour
1.  Setup
2. PyCharm UI and Projects
3. Running Python Code
4. Productive Coding
5. Code Navigation
6. Debugging
7. Testing
8. Customizing PyCharm

In the near future we’re going to create some additional video tutorials, that cover other important features in more details, so stay tuned. Enjoy the tutorials and please do provide us with your feedback on what features or functionality you’d like to watch in the next videos!

Drive to Develop
PyCharm team

Posted in Cool Feature, Screencast, Tutorial, Video | 7 Comments

[Webinar Recording] Polyglot PyCharm for Rich Web Front-ends

The recording of our January 12th webinar, Polyglot PyCharm for Rich Web Front-ends, is now available on JetBrains YouTube Channel. Paul Everitt’s code used in the recording along with the script for each step in the webinar can be found on GitHub.

Polyglot PyCharm for Rich Web Front-ends

Python has long been a staple of web development. In the recent world of “web apps”, though, the browser is playing a larger role. More of the application in a web app is done in JavaScript, in the “frontend”, with Python running UI-less data services in the “backend”. With its IntelliJ/WebStorm foundations, PyCharm can cover modern HTML/CSS/JS workflows. In this webinar, I’ll show building a JS MVC web app talking to a Python backend using REST, all from the perspective of a veteran Python developer.

The list of topics with timing:

00:20 Node Walkthrough
02:22 Webinar Overview
04:40 Repository for code samples
05:10 Flask ToDoMVC Starting Point
08:32 Add “Delete” Button
12:03 Packaging with npm and package.son
21:29 Tooling with aslant
31:45 Automation with npm run scripts
35:10 Move frontend out of backend with CORS
45:00 Pythonic modules with ES6, Babel, and Webpack

Note: The webinar was a huge success. We’ve got a lot of positive feedback in the after-webinar survey. As we hadn’t managed to cover all the topics declared in the webinar plan we decided to fire up another one webinar soon, which is supposed to cover “ES6 Modules with Babel and Webpack” and “Pythonic ES6” topics in more details. Stay tuned for the announcement.

Keep up with the latest PyCharm news on our blog and follow us on Twitter @PyCharm.

The Drive to Develop
– PyCharm team

Posted in Cool Feature, Screencast, Video, Webinar | 4 Comments