My python entrypoint needs to be run as a module (not a script), as in:
python -m foo.bar
The following does not work (and is not supposed
In PyCharm 2016 specifying -m without a script path doesn't work, as they use a wrapper script that doesn't accept the -m argument.
Here's my solution, which works for run & debug configurations: https://github.com/amnong/misc/tree/master/pycharm_runner
Edit: I just read J. R. Petrus's comment, and my solution is very similar. BTW I also tried to support proper entry points using pkg_resources, but for some reason pkg_resources.load_entry_point() could not find my project's distribution...