Not sure how I can use flake8/flake8 as entry_point since this module is installed in Scripts (on windows) which is not available in the path. That's why I used run. I am fairly new to this so I'd be happy to learn how :)
For 2), I used the the kwargs dict that was added lately. I am also adding the cmd to scripts only if when NOT using setuptools. This avoids having the exe and the cmd at the same time when it's not necessary.
You can move all the code of the flake8 script into a module under flake8/, then use it as a console entry point of setuptools is instannled *AND* in the modified version of the flake8 script -- which then is just a wrapper that calls the new one.
flake8 is already a wrapper around run.py, isn't a bit odd to add a wrapper around that for the sake of not using run.py as the console script? Do I just rename run.py to flake.py and move flake8 to scripts, the folder I created for flake8.cmd?
The cmd is there because flake8 won't run on Windows unless you call it with the interpreter (python flake8 <options_here>), which su*ks. We need this on Windows when setuptools is not installed (that's the whole point of issue #22 I am trying to solve here). To make this clearer in the setup, I added a check on the platform (iswin) in my last commit to avoid installing a cmd script on non-Windows os’es.
I believe the code I suggest is pretty much a reflection of the pseudocode.
Note that I left the existing flake8 script because I didn't want to break any existing code which could depend on this script being installed. I didn't see the point in removing it either.
Some of us have to live inside Windows, not always by choice ;-)