flameprof
flameprof copied to clipboard
Fix script to use pip's python version
Problem
On systems where python points to python2 but pip points to pip3, bin/flameprof breaks because it runs python2 but the flameprof library is installed into python2's site-packages.
Fix
Instead of using scripts in setup.py, use the console_scripts entry point (https://python-packaging.readthedocs.io/en/latest/command-line-scripts.html). This will automatically create and install a flameprof script that works with python 2 or 3 (whichever pip is working with).
In order to facilitate this, I created a main function in flameprof.py.
Would be great if this could be merged and a new release made.