PyCharm 2018.2 EAP 4

We’re now in our fourth installment of a pretty big 2018.2 Early Access Program cycle. Lots to take a look at by downloading EAP 4 from our website.

New in PyCharm 2018.2 EAP 4

Pipenv support

We know many of you have been waiting for this for a long time, so here you go: Pipenv is supported in PyCharm 2018.2. There is still a lot of work before we finally release stable PyCharm 2018.2 so your input with bug reports or suggestions is very welcome in our issue tracker.

Currently supported Pipenv-related features in PyCharm:

  • The Pipenv environment type in the Python interpreter dialog (for new or existing projects)
  • A quick fix for setting up the Pipenv for a project with Pipfile
  • Automatically create/set up Pipenv for a directory with Pipfile opened for the first time
  • Auto-suggestion to download the Toml plugin for Pipfile
  • Selection of the base Python executable while configuring a new Pipenv
  • Use Pipenv for managing packages and updating Pipfile
  • Display the list of installed packages via Pipenv
  • Use the indices defined in Pipfile.lock to browse available packages
  • A configurable location for Pipenv via Python Integrated Tools
  • Using Pipenv in the quick fix to install an unresolved import
  • Checking missing package requirements based on Pipfile.lock
  • Quick-fix to install missing packages via Pipenv
  • Notification about changed and not locked pipfile and a link to lock it

pytest-bdd Support

In this EAP we introduce an initial support for pytest-bdd. To enable the pytest-bdd support open the BDD settings dialog (File | Settings/Preferences | Languages & Frameworks | BDD ) and from the Preferred BDD framework list select pytest-bdd. We’re continuing to work on py-bdd support, so your input is much appreciated.

More details on pytest-bdd support in PyCharm

Type hints validation

Any time you’re applying type hints, PyCharm checks if the type is used correctly. If there is a usage error, the corresponding warning is shown and the recommended action is suggested.

Learn more about type hints validation in PyCharm

New Front-End Development Functionality

As you might already know, PyCharm bundles all features available in WebStorm, a front-end development IDE by JetBrains. PyCharm EAP 4 adds several WebStorm EAP features:

  • Code coverage tool with visual indicators on folders, files, and code about the percentage of coverage
  • Test files are automatically added to the Tests scope to help adjust IDE settings such as inspection severity
  • New UI for inspection tooltips with key binding to apply the first fix
  • Support for Node.js on Windows Subsystem for Linux (WSL)
  • Remote mappings in Attach to Node.js configuration
  • New intentions in JavaScript, TypeScript, and JSON: implement an interface, create derived class, generate cases for the switch, add properties missing from a JSON schema, and more
  • That’s right: an earlier EAP had improved validation from a JSON Schema

PyCharm 2018.2 EAP 4 Release Notes

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.2 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.2 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.

This entry was posted in Early Access Preview and tagged . Bookmark the permalink.

16 Responses to PyCharm 2018.2 EAP 4

  1. Henry Borchers says:

    pipenv support is here! Yay.

    • Paul Everitt says:

      A lot of work went into it, but we’re expecting a list of things reported on it in this EAP. Will take a while to iron out.

      • Great work that you did it.
        I tested it out immediately and would like to give you my feedback:

        1) Activating pipenv support manually

        If I create a project from an existing directory with a Pipfile, pipenv will be activated automaticially, which is really nice. But when adding a Pipfile manually to an existing project (either by creating a Pipfile in the editor by myself, or via checking out a commit where the Pipfile was added) there is no way to activate pipenv support!
        In fact I would expect PyCharm to detect an added Pipfile and ask me if it shall switch over to pipenv.

        2) pipenv lock/update via GUI

        pipenv lock/update can be done via GUI only via a balloon notification after modifying the Pipfile. This is has a bunch of drawbacks:
        – if the balloon is closed (accidentially or by intention) there is no way to run pipenv update/lock at a later time
        – if the balloon is closed, the GUI does not show me any more if the Pipfile needs to be updated or.
        – there are no keyboard shortcuts for pipenv update/lock
        Don’t get me wrong. The balloon notification is perfect, but there should be an additional way to check if the Pipfile is up to date or not (i.e. in CLion there is a yellow bar at the top which tells me if it is in sync or not). Furthermore There should be a Menuitem for updating/locking the pipenv.

        3) adding/removing/updating Packages

        pipenv provides a pip compatible interface for package management, which is really neat. Of course one could also edit Pipfile directly but doing it via “pipenv install …” is much more comfortable for most cases.
        PyCharm has a very comfortable GUI interface for pip (Settings / Project / Project Interpreter). Why not utilitizing this exsting GUI interface for pipenv? (instead of calling “pip install …” pycharm simply has to call “pipenv install …” internally).

        Even worse: currently I can add a package via the GUI which changes my virtualenv but not my Pipfile. In my opinion this is a source of errors as PyCharm claims to work with pipenv, but its package manager interface is bypassing pipenv.

        3) what is ‘Syncronize Pipfile’ for?

        There is a pipenv ‘sync’ command. But this is for Pipfile.lock.
        When I clicked it I saw action.

        4) Managing the Project-Interpreter in PyCharm Project

        Currently the Project Interpreter is managed by PyCharm independently of pipenv (Settings / Project / Project Interpreter). The problem is, that this means pipenv and PyCharm could get out of sync when pipenv creates a new virtualenv. I.e. in the following cases:
        – changing ‘python_version = “XXX”‘ will make pipenv to create a new virtualenv.
        – when renaming the project directory pipenv will create a new virtualenv
        – when sharing the pycharm project via git (or any vcs). After cloning it will contain the project interpreter of the original repo instead of the new one created by pipenv.

        I suppose that this behaviour is a very central aspect of the current architecture and thus hard to change.
        But at least you could do some kind of “autosync” the pycharm interpreter with the pipenv interpreter after opening a project, doing a git checkout or modifiying the Pipfile manually.

        • Andrey Vlasovskikh says:

          Robert, thanks for your feedback! Feel free to write more if you feel there are any more problems left. In my reply I’m going to ask you to create several new follow-up issues in our tracker.

          1) Activating pipenv support manually

          Currently we suggest the “Use Pipenv” quick-fix only if your project has no interpreter. It’s a bit early to suggest using Pipenv for correctly-configured projects that have Pipfile due to the fact that it’s still a very new feature. Could you please file a feature request for it? It’s one of the things we might add soon.

          2) pipenv lock/update via GUI

          We could show the yellow warning bar, but currently this notification is rather limited and not 100% correct. We detect changes in Pipfile compared to Pipfile.lock just by looking at your edits to Pipfile inside PyCharm. Pipfile.lock actually has a hash of Pipfile in it, but it’s a hash not of the file contents, but of a special serialized JSON representation of Pipfile which is internal to the pipenv tool. If there is a way to reliably determine if Pipfile.lock is out-of-date, we will switch from balloon notifications to warnings. The question about a keyboard shortcut is still relevant. It would be great to create two new issues about these problems: the one about switching to more reliable warnings, and another one about keyboard shortcuts for selecting the actions in the balloon.

          3a) adding/removing/updating Packages

          We do use pipenv instead of pip with the correct options and arguments for managing packages. Pipenv updates your Pipfile when you install / delete packages via the PyCharm UI. Make sure that you’ve select a Pipenv interpreter for your project (named “Pipenv (<project-name>)”).

          3b) what is ‘Syncronize Pipfile’ for?

          Are you referring to the “Synchronize ‘Pipfile'” in the context menu of the file? It’s an action to synchronize a file from your file system. It’s available for all files in your project and has nothing to do with Pipenv.

          4) Managing the Project-Interpreter in PyCharm Project

          If you re-create your Pipenv-managed virtualenv outside of PyCharm with a different Python version, PyCharm won’t pick up this change until you restart PyCharm. Please file a bug about it. We’ll find a way to detect this change while PyCharm is running with the old interpreter version still in use.

          Yes, PyCharm currently doesn’t track renames. If the old virtualenv is not removed, PyCharm might become out of sync with your environment. Please create an issue with specific steps if you experience this problem.

          You can share your .idea/ settings including your .iml with your Pipenv interpreter name in it: “Pipenv (<project-name>)”. When another person gets this project from a VCS repo, PyCharm will show a yellow warning “No Python interpreter configured for this project” for any *.py file and the quick-fix “Use Pipenv interpreter” that will set up an interpreter for them automatically (with the same name).

  2. Steve Piercy says:

    Y’all overlooked the most important feature ever! reStructuredText preview!
    https://confluence.jetbrains.com/display/PYH/PyCharm+182.3341.8+Release+Notes

    • Paul Everitt says:

      You’re right, we left that out! I was thinking of you when I saw that on the release notes. We’ll try to get an addendum out tomorrow. (I’m actually using that preview as we speak.)

    • Paul Everitt says:

      Actually, Dmitry intentionally omitted it. We’re mentioning it on the next EAP when the docs and a tutorial are done.

  3. Milosz Pogoda says:

    All features in upcoming release look absolutely fantastic! Thanks guys for your great work!

  4. Jeff says:

    Hey guys, I’m glad to see the pipenv support. I’ve been playing with it today and I can’t figure out something. Hopefully I’m just overlooking something simple.

    In our projects we use a dotenv (.env) file in the project root. The pipenv tool automatically loads our envs from that file – https://docs.pipenv.org/advanced/#automatic-loading-of-env

    I was expecting the Django server run configuration, python console and Django console to all pick up those envs once I switched to using a pipenv interpreter. Or at least a setting somewhere to tell PyCharm to do that.

    But it doesn’t seem the automatic dotenv loading is happening. Any ideas? Or just not implemented?

Leave a Reply

Your email address will not be published. Required fields are marked *