Pull requests

#21 Merged
Repository
Deleted repository
Branch
default (0be9af784037)
Repository
tarek/flake8 flake8
Branch
default

added entry point for flake8 command

Author
  1. Marc Labbe
Reviewers
Description

Solves issue #22. Includes a cmd file to run when setuptools isn't available. Tested with Python 2.7 in virtualenv with distribute. Tested with Python 3.2.3 w/o setuptools or distribute.

Comments (8)

    1. Marc Labbe author

      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.

      Let me know about 1) and I'll update the request.

      1. Tarek Ziadé repo owner

        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.

        1. Marc Labbe author

          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?

          1. Tarek Ziadé repo owner

            mmm then I don't understand why you've created scripts/flake8.cmd

            flake8.run.main can be the console entry point if setuptools is around, right ? and the rest remain unchanged

            e.g. in pseudo code:

            if setuptools: console = 'flake8 = flake8.run.main' scripts = [] else: scripts = ["flake8/flake8"]

            1. Marc Labbe author

              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 ;-)