python - Running a pylinter with jenkins -


i trying set jenkins job run lint.py file. jenkins command running is:

 pip install -r requirements.txt   python lint.py 

and output i'm seeing is:

requirement satisfied (use --upgrade upgrade): pylint in /var/lib/jenkins/.local/lib/python2.7/site-packages (from -r requirements.txt (line 1)) requirement satisfied (use --upgrade upgrade): sqlalchemy in /var/lib/jenkins/.local/lib/python2.7/site-packages (from -r requirements.txt (line 2)) requirement satisfied (use --upgrade upgrade): pandas in /var/lib/jenkins/.local/lib/python2.7/site-packages (from -r requirements.txt (line 3)) requirement satisfied (use --upgrade upgrade): python-dateutil in /usr/local/lib/python2.7/dist-packages (from pandas->-r requirements.txt (line 3)) requirement satisfied (use --upgrade upgrade): pytz>=2011k in /var/lib/jenkins/.local/lib/python2.7/site-packages (from pandas->-r requirements.txt (line 3)) requirement satisfied (use --upgrade upgrade): numpy>=1.7.0 in /var/lib/jenkins/.local/lib/python2.7/site-packages (from pandas->-r requirements.txt (line 3)) cleaning up... + python lint.py sh: 1: pylint: not found sh: 1: pylint: not found sh: 1: pylint: not found sh: 1: pylint: not found sh: 1: pylint: not found sh: 1: pylint: not found sh: 1: pylint: not found sh: 1: pylint: not found sh: 1: pylint: not found sh: 1: pylint: not found sh: 1: pylint: not found sh: 1: pylint: not found ['lint.py'] no directory specified, defaulting current working directory 

at point job fails.

so: package installed, yet it's not being found when lint.py run.

when manually, can sudo pip install pylint, , lint.py run happily, isn't option jenkins job. also, belive should able work without sudo, since package is installed somwhere. have tried adding pythonpath="/var/lib/jenkins/.local/lib/python2.7/site-packages" python lint.py command, got same result.

does know can enable lint.py run? thanks.

looks pylint isn't installed. os running on? if debian or ubuntu:

sudo apt-get install pylint 

if doesn't work validate the python setup using setup expect.

which python pip pip freeze 

alternatively following plugin might work you:

https://wiki.jenkins-ci.org/display/jenkins/violations


Comments