PyCharm 2018.3.1 RC Out Now

PyCharm 2018.3.1 Release Candidate is now available, with various bug fixes. Get it now from our Confluence page.

Improved in This Version

  • A fix for the recently added WSL support in PyCharm 2018.3
  • A few fixes for Docker and Docker Compose
  • Fixes for the embedded terminal
  • Many fixes coming from WebStorm, DataGrip and IntelliJ IDEA; see the release notes for details

Interested?

Download the RC from our confluence page

If you’re on Ubuntu 16.04 or later, you can use snap to get PyCharm RC versions and stay up to date. You can find the installation instructions on our website.

The release candidate (RC) is not an early access program (EAP) build, and does not bundle an EAP license. To use PyCharm Professional Edition RC, you will need a currently active PyCharm subscription. If none is available, a free 30-day trial will start.

Posted in Early Access Preview | Tagged | 2 Comments

Let PyCharm Do Your Import Janitorial Work

What’s something you do all the time in Python? Import modules from packages. Not just that, you also fiddle with the formatting to make the style nannies happy. And remove unused imports. And bunches of other janitorial tasks.

Let PyCharm be your janitor. PyCharm has tons of support to take over this mundane drudgery, from auto-import to re-organizing your import lines, with settings to customize its work.

This support is both super-helpful and underappreciated. Let’s solve that with a deep dive on PyCharm’s import support, including new import styling features in PyCharm 2018.3.

Zen Coding

You’re coding away, in the zen flow, and then…you want to use the requests library. It’s installed in your virtualenv, you just need to import it. So away you go, up to the top of the file, looking for the right place to manually import it.

Manual

Instead, let PyCharm do it for you. Start typing part of requests and type Ctrl-Space-Space. PyCharm will offer a completion. When you accept it, PyCharm will complete the symbol and also generate the import.

CtrlSpaceSpace

Sometimes you cut-and-paste some code and already have requests typed out completely. Or, perhaps you can type faster than doing autocomplete. Put your cursor somewhere in requests and hit Alt-Enter to bring up the Code Inspection. PyCharm has a choice to Import this name. As with Ctrl-Space, PyCharm generates the import:

AltEnter

If you already have an import from that package, PyCharm merges into the existing import line:

Merge Import

PyCharm calls this the Import Assistant. You stay where you are, it manages the import.

Generating the import is half the annoyance. Equally frustrating? Constant gardening of the long list of imports: re-sorting, pruning unused imports, joining or splitting. Janitorial work like that is what PyCharm lives for.

First, let’s put our imports into a messy state: bad sorting and unused imports.

Use the Optimize Imports action to let PyCharm clean this up. You can trigger this action with Ctrl-Alt-O but, if you haven’t memorized that, use Find Action. The result: nice import lines:

Optimize Imports

PyCharm can optimize imports in a single file. But you can also optimize imports across the entire project. Select the folder at your project root, then trigger Optimize Imports (from the menu, the shortcut, or Find Action.)

Working with Packages

That’s two drudgeries in the bag already — generating imports and gardening the import list. Here’s another: what if you don’t have the package installed yet?

We saw with imports the zen mode: you start typing and tell PyCharm to do the work. Same here: type your import, hit Alt-Enter, and choose Install and import package:

Maya

This is explained further in the tip on the help page.

Thus, in the middle of using the import, rather than interrupt your flow, tell PyCharm to go install the package into your project interpreter. As a bonus, if you have a setup.py or requirements.txt registered with your project, then PyCharm can record this package as an entry. That’s a nice flow.

07 Requirements Poster

Import Preferences

PyCharm follows PEP 8’s guidance on import style. For example, PyCharm will warn you if you have an import mixed into your module code, instead of at the top. By default, Optimize Imports will do the joining and sorting from PEP 8. And finally, if you generate another import from an already-imported package, PyCharm will add the new symbol to the existing import line.

What if you want some flexibility? PyCharm’s project preferences let you change sorting and the joining behavior:

Preferences

I have a colleague who wants easier-to-track diffs by putting each import on its own line. PyCharm lets you toggle this setting, switching from joining imports to splitting them.

Split Imports

JavaScript and CSS Too

But wait, there’s more. If you do frontend development (JavaScript, HTML, CSS) in PyCharm Professional, then you get all of this and even a little more, on that side of the fence: imports in ES6, CSS, SASS, and more.

Narrated Video

We often say that a big part of PyCharm’s value is how it does the janitorial work for you. Managing imports is a perfect example of that.

Posted in Cool Feature, Tutorial | Tagged | Leave a comment

PyCharm 2018.3 Out Now

PyCharm 2018.3 is now available: Windows Subsystem for Linux (WSL) support, multiline TODOs, improved search everywhere, and more.

Download PyCharm 2018.3

New in PyCharm

  • For those of you on Windows who are developing applications that run on Linux: Windows Subsystem for Linux is a quick and easy way to always have a Linux environment available. PyCharm 2018.3 can now be configured to use a Python interpreter inside WSL.
  • One of the most-requested features in our issue tracker were multiline TODOs, and we’re happy to announce that these are now available in PyCharm 2018.3.
  • Even though search everywhere (double-shift) is not at all a new feature, we’ve made some great usability improvements, and now it’s easy to see how you can narrow down the results.

Read more about new features on our website. You can also find the full release notes here.

Upgrade Now

To get the new version of PyCharm, upgrade in one of the following ways:

Do you have questions, complaints, or suggestions? Please reach out to us! Send questions to our support team, report bugs and suggestions on our issue tracker, or just connect with us on Twitter.

Posted in Release Announcements | Tagged | Leave a comment

Webinar: “Automating Build, Test and Release Workflows with tox” with Oliver Bestwalter

Python’s tox project is a critical tool for quality software production. Most of our users and customers know about it, but haven’t made the time to learn it.

This webinar’s for you. Oliver Bestwalter is one of the maintainers of tox, and as he discussed in a recent Test and Code interview, has many ideas on how to automate the build/release process.

  • Thursday, December 13
  • 4:00 PM – 5:00 PM CET (10:00 AM – 11:00 PM EST)
  • Register here
  • Aimed at intermediate Python developers

Webinar Bestwalter Register

Agenda

We will look at what is necessary to automate all important workflows involved in building, testing and releasing software using tox.

We’ll cover how to use tox to …

  • run static code analysis, automatic code formatting/fixing as a separate stage orchestrated by the pre-commit framework
  • run tests with pytest
  • measure and report test coverage
  • build and upload packages to pypi/devpi/artifactory

All this can be run and debugged locally from the command line or programmatically.

These building blocks can then form a complete build, test and release pipeline to be run on CI systems like Travis-CI, Gitlab, Jenkins, Teamcity, etc.

If time permits, we’ll also look at how projects like tox and pytest are automating their own processes.

Speaking to You

Oliver is an engineer at Avira who fell in love with open source in the 1990s and with Python in 2006. He creates and helps to maintain test and automation tools helping developers and companies to produce better software more effectively.

Since 2011 he has been a Software Developer at Avira, helping a diverse range of product teams to improve their build, test and release processes. He strives to be a good open source citizen by helping to maintain and improve projects in the area of testing and automation. As part of this effort he spends 20% of his time at Avira working on open source projects. He also enjoys accompanying others on their journey, helping them to improve their skills, and acts as a coach and mentor at Avira and with the Python Academy. When he gets the chance (and can rustle up the courage) he also talks at conferences and meetups.

In 2016 he joined the tox project and is now one of the maintainers. Since 2017 he has been spending up to 20% of his time at Avira working on tox and other open source projects.

-PyCharm Team-
The Drive to Develop

Posted in Webinar | Tagged | Leave a comment

PyCharm 2018.3 RC 2

We’re putting the final touches on PyCharm 2018.3 to prepare for our release. You can get our second release candidate from our website

Fixed in This Version

  • The “There is a plugin available” notification would open the wrong window
  • For some users, some UI elements weren’t visible
  • The Markdown preview window wouldn’t load images correctly
  • Read the release notes for details

Interested?

Download the RC from our website. Alternatively, you can use the JetBrains Toolbox App.

If you’re on Ubuntu 16.04 or later, you can use snap to get the PyCharm RC, and stay up to date. You can find the installation instructions on our website.

The release candidate is not an EAP version, this means that you will either need to have an active PyCharm license, or you’ll receive a 30 day free trial for PyCharm Professional Edition. The community edition is free and open source as usual.

Posted in Early Access Preview | Tagged | Leave a comment

PyCharm 2018.1.6 and 2017.3.7

We’ve fixed an issue in our custom Java Runtime Environment for older versions of PyCharm. If you’re using PyCharm 2017.3 or PyCharm 2018.1, please update to the new version.

Fixed in These Versions

Keyboard issues in macOS Mojave

After typing a special character by pressing and holding a key, the IDE would not accept any other input after inserting the special character. This has now been resolved.

To Update

Download the new version from our website, choose Help | Check for Updates in the IDE, or use JetBrains Toolbox to keep all of your JetBrains IDEs updated.

Posted in Release Announcements | Tagged | Leave a comment

PyCharm 2018.2.5

PyCharm 2018.3 is almost ready for release, however, first we’d like to release some important fixes for PyCharm 2018.2. You can update to 2018.2.5 now: either on our website, within PyCharm (Help | Check for Updates), or using JetBrains ToolBox.

New in 2018.2.5

  • An issue that causes PyCharm to crash on Ubuntu 16.04 has been resolved
  • Matplotlib 3.0.0 can now be imported in the Python Console
  • Python code now folds correctly after it’s minimized with Ctrl+Shift+Numpad – (Cmd+Shift+- on macOS)
  • And further fixes, see the release notes for more information

Interested?

Download PyCharm 2018.2.5

Posted in Release Announcements | Tagged | Leave a comment

PyCharm 2018.3 Release Candidate

PyCharm 2018.3 is almost ready to be released, and that’s why we’re happy to present the release candidate for PyCharm 2018.3. Download this version from our website

New in This Version

Multiline TODOs

Multiline Todos

If you like to put TODOs in your code to remember yourself (or your colleagues) to further improve a part of your code, you now have more space to do so. If you indent the line after the line with ‘TODO’ (or ‘FIXME’, or anything you configure in Settings | Editor | Todo) it’ll be treated as a continuation of the todo.

Further Improvements

  • Various Docker Compose fixes
  • An issue where PyCharm would freeze when using Ctrl-C in the Python console has been resolved
  • Debugging node.js code on WSL could in some cases result in an exception, this is now fixed
  • And more, read the release notes

Interested?

Download the RC from our website. Alternatively, you can use the JetBrains Toolbox App.

If you’re on Ubuntu 16.04 or later, you can use snap to get the PyCharm RC, and stay up to date. You can find the installation instructions on our website.

The release candidate is not an EAP version, this means that you will either need to have an active PyCharm license, or you’ll receive a 30 day free trial for PyCharm Professional Edition. The community edition is free and open source as usual.

Posted in Early Access Preview | Tagged | 3 Comments

PyCharm 2018.2.5 RC

We have a couple of fixes for PyCharm 2018.2 which you can now try in the 2018.2.5 Release Candidate.

New in 2018.2.5 RC

  • An issue that causes PyCharm to crash on Ubuntu 16.04 has been resolved
  • Matplotlib 3.0.0 can now be imported in the Python Console
  • Python code now folds correctly after it’s minimized with Ctrl+Shift+Numpad – (Cmd+Shift+- on macOS)
  • And further fixes, see the release notes for more information

Interested?

Download PyCharm 2018.2.5 RC from our confluence page.

The release candidate is not an Early Access Program (EAP) release, so you’ll either need a valid license, or you’ll have a 30-day free trial.

Posted in Early Access Preview | Tagged | Leave a comment

PyCharm 2018.3 EAP 9

We’ve entered the final phase of the Early Access Program (EAP) for PyCharm 2018.3, the ninth version is now available. Download this version from our website

New in This Version

Enhanced GitHub Integration

GitHub

We’ve included a couple of cool GitHub specific features in PyCharm. You can now update your fork of GitHub projects you contribute to right from PyCharm, then do some work, and create a pull request.

Do you maintain a project? You can now check out pull requests in PyCharm, and check out a branch to play with it right from the version control tools in your IDE.

Further Improvements

  • The Python 3.7 breakpoint() statement will now trigger the PyCharm debugger to break. Of course, you can still use regular breakpoints and prevent yourself from accidentally checking in a debugging statement.
  • A bug that caused Gtk to not have code completion has been resolved.
  • Sometimes when opening a task in PyCharm, the IDE would freeze for a long time, this has been resolved now. Did you know that PyCharm integrates with your issue tracker? Read more in our docs
  • And more, check out the release notes for more details

Interested?

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. You can find the installation instructions on our website.

PyCharm 2018.3 is in development during the EAP phase, therefore not all new features are already available. More features will be added in the coming weeks. As PyCharm 2018.3 is pre-release software, it is not as stable as the release versions. Furthermore, we may decide to change and/or drop certain features as the EAP progresses.

All EAP versions will ship with a built-in EAP license, which means that these versions are free to use for 30 days after the day that they are built. As EAPs are released weekly, you’ll be able to use PyCharm Professional Edition EAP for free for the duration of the EAP program, as long as you upgrade at least once every 30 days.

Posted in Early Access Preview | Tagged | 5 Comments