2013-04-06 19:45:15 +00:00
|
|
|
Installation
|
|
|
|
------------
|
|
|
|
|
|
|
|
|
2013-04-29 13:31:03 +00:00
|
|
|
Python packages
|
|
|
|
'''''''''''''''
|
|
|
|
|
2016-07-03 17:39:13 +00:00
|
|
|
Pylint should be easily installable using pip.
|
|
|
|
|
|
|
|
.. code-block:: sh
|
|
|
|
|
|
|
|
python -m pip install pip
|
2013-04-29 13:31:03 +00:00
|
|
|
|
2013-04-06 19:45:15 +00:00
|
|
|
|
|
|
|
Source distribution installation
|
|
|
|
''''''''''''''''''''''''''''''''
|
2013-04-17 08:33:52 +00:00
|
|
|
|
2013-04-29 13:31:03 +00:00
|
|
|
From the source distribution, extract the tarball, go to the extracted
|
|
|
|
directory and simply run ::
|
2013-04-06 19:45:15 +00:00
|
|
|
|
|
|
|
python setup.py install
|
|
|
|
|
2016-07-03 17:39:13 +00:00
|
|
|
Or you can install it in editable mode, using ::
|
2013-04-06 19:45:15 +00:00
|
|
|
|
2016-07-03 17:39:13 +00:00
|
|
|
python setup.py develop
|
2013-04-06 19:45:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
Note for Windows users
|
|
|
|
''''''''''''''''''''''
|
|
|
|
|
|
|
|
On Windows, once you have installed Pylint, the command line usage is ::
|
|
|
|
|
|
|
|
pylint.bat [options] module_or_package
|
|
|
|
|
|
|
|
But this will only work if *pylint.bat* is either in the current
|
2014-08-14 14:13:46 +00:00
|
|
|
directory, or on your system path. (*setup.py* will install *python.bat*
|
2013-04-06 19:45:15 +00:00
|
|
|
to the *Scripts* subdirectory of your Python installation -- e.g.
|
|
|
|
C:\Python24\Scripts.) You can do any of the following to solve this:
|
|
|
|
|
2014-08-14 11:54:33 +00:00
|
|
|
1. Change to the appropriate directory before running pylint.bat
|
2013-04-06 19:45:15 +00:00
|
|
|
|
2014-08-14 11:54:33 +00:00
|
|
|
2. Add the Scripts directory to your path statement in your autoexec.bat
|
2013-04-06 19:45:15 +00:00
|
|
|
file (this file is found in the root directory of your boot-drive)
|
|
|
|
|
2014-08-14 11:54:33 +00:00
|
|
|
3. Create a 'redirect' batch file in a directory actually on your
|
2013-04-06 19:45:15 +00:00
|
|
|
systems path
|
|
|
|
|
|
|
|
To effect (2), simply append the appropriate directory name to the PATH=
|
|
|
|
statement in autoexec.bat. Be sure to use the Windows directory
|
|
|
|
separator of ';' between entries. Then, once you have rebooted (this is
|
|
|
|
necessary so that the new path statement will take effect when
|
|
|
|
autoexec.bat is run), you will be able to invoke Pylint with
|
|
|
|
pylint.bat on the command line.
|
|
|
|
|
2013-04-29 13:31:03 +00:00
|
|
|
(3) is the best solution. Once done, you can call Pylint at the command
|
2013-04-06 19:45:15 +00:00
|
|
|
line without the .bat, just as do non-Windows users by typing: ::
|
|
|
|
|
|
|
|
pylint [options] module_or_package
|
|
|
|
|
|
|
|
To effect option (3), simply create a plain text file pylint.bat with
|
|
|
|
the single line: ::
|
|
|
|
|
|
|
|
C:\PythonDirectory\Scripts\pylint.bat
|
|
|
|
|
|
|
|
(where PythonDirectory is replaced by the actual Python installation
|
|
|
|
directory on your system -- e.g. C:\Python24\Scripts\pylint.bat).
|
2016-07-03 17:39:13 +00:00
|
|
|
|
|
|
|
Alternatively, you can run pylint using the ``-m`` flag, as in:
|
|
|
|
|
|
|
|
.. code-block:: sh
|
|
|
|
|
|
|
|
python -m pylint module_or_package
|