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.
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.
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.
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.
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:
If you already have an import from that package, PyCharm merges into the existing import line:
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:
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:
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.
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:
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.
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.
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.
If you’re using Ubuntu, or any other distro that supports snap, PyCharm will automatically update using snap (if you’ve installed PyCharm with snap).
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.
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.
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.
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.
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.
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)
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
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
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.
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
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
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.