Tuesday, May 08, 2007

A More Complete PyLint on Windows Walkthrough

Others have posted about getting pylint installed on Windows, but I always fell short getting the steps to lead to the destination. Some tinkering and I got it right. This also includes the instructions to get it integrated into Komodo.
  1. Grabbing the Goods
    First off the bat we need to grab all the packages we need. pylint depends on two other packages from Logilabs, who write pylint for us. We need to grab the latest releases of pylint, logilab-astng, and logilab-common.
  2. Extract all of these somewhere to install from.
  3. Open a command shell and move to each of the directories, executing the install command in each:
    python setup.py install
  4. Feel free to remove the extracted files now that everything has been installed. You can use pylint now. On to Komodo integration.
  5. In Komodo, open the toolbox from the View menu with View->Tabs->Toolbox. Now, click your "Add Item to Toolbox" button in the new tab, and select "New Command..." to add a command to Komodo that will analyze your current file with pylint.
  6. For the command enter the line 'python -c "import sys,pylint.lint;pylint.lint.Run(sys.argv[1:])" "%F"'. This will import pylint, handle spaces in Windows filenames, and run the processing on your file.
  7. Check the "Parse output with:" box and enter this regular expression to parse the lines from pylint, '.*?:(?P<line>\d+):\s*(?P<content>.*?)$'. Also, check the "Show parsed output as list" box.
  8. Optionally, bind a key shortcut from the Key Binding tab. I use ctrl+alt+L.

No comments:

I write here about programming, how to program better, things I think are neat and are related to programming. I might write other things at my personal website.

I am happily employed by the excellent Caktus Group, located in beautiful and friendly Carrboro, NC, where I work with Python, Django, and Javascript.

Blog Archive