Move pylint plugins to an installed package.
This means we can now run things like running pylint --version without having to set PYTHONPATH correctly now. When using skip_install=true, the plugins wouldn't work as they need to import qutebrowser. We have to keep setting PYTHONPATH in run_pylint_on_tests.py, otherwise we get this error I don't quite understand: F: 1, 0: error while code parsing: Unable to load file '/home/florian/proj/qutebrowser/git/__init__.py' ([Errno 2] No such file or directory: '...') (parse-error)
This commit is contained in:
parent
67b9904772
commit
0b362e76ea
@ -3,10 +3,10 @@
|
|||||||
[MASTER]
|
[MASTER]
|
||||||
ignore=resources.py
|
ignore=resources.py
|
||||||
extension-pkg-whitelist=PyQt5,sip
|
extension-pkg-whitelist=PyQt5,sip
|
||||||
load-plugins=pylint_checkers.config,
|
load-plugins=qute_pylint.config,
|
||||||
pylint_checkers.modeline,
|
qute_pylint.modeline,
|
||||||
pylint_checkers.openencoding,
|
qute_pylint.openencoding,
|
||||||
pylint_checkers.settrace
|
qute_pylint.settrace
|
||||||
|
|
||||||
[MESSAGES CONTROL]
|
[MESSAGES CONTROL]
|
||||||
enable=all
|
enable=all
|
||||||
|
4
scripts/dev/pylint_checkers/setup.py
Normal file
4
scripts/dev/pylint_checkers/setup.py
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# This is only here so we can install those plugins in tox.ini easily.
|
||||||
|
|
||||||
|
from setuptools import setup
|
||||||
|
setup(name='qute_pylint', packages=['qute_pylint'])
|
@ -60,7 +60,7 @@ def main():
|
|||||||
]
|
]
|
||||||
|
|
||||||
toxinidir = sys.argv[1]
|
toxinidir = sys.argv[1]
|
||||||
pythonpath = os.environ['PYTHONPATH'].split(os.pathsep) + [
|
pythonpath = os.environ.get('PYTHONPATH', '').split(os.pathsep) + [
|
||||||
toxinidir,
|
toxinidir,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
6
tox.ini
6
tox.ini
@ -122,8 +122,6 @@ commands =
|
|||||||
[testenv:pylint]
|
[testenv:pylint]
|
||||||
basepython = python3
|
basepython = python3
|
||||||
ignore_errors = true
|
ignore_errors = true
|
||||||
skip_install = true
|
|
||||||
setenv = PYTHONPATH={toxinidir}/scripts/dev
|
|
||||||
passenv =
|
passenv =
|
||||||
deps =
|
deps =
|
||||||
{[testenv]deps}
|
{[testenv]deps}
|
||||||
@ -131,6 +129,7 @@ deps =
|
|||||||
astroid==1.4.4
|
astroid==1.4.4
|
||||||
pylint==1.5.4
|
pylint==1.5.4
|
||||||
requests==2.9.1
|
requests==2.9.1
|
||||||
|
./scripts/dev/pylint_checkers
|
||||||
commands =
|
commands =
|
||||||
{envpython} scripts/link_pyqt.py --tox {envdir}
|
{envpython} scripts/link_pyqt.py --tox {envdir}
|
||||||
{envpython} -m pylint scripts qutebrowser --output-format=colorized --reports=no
|
{envpython} -m pylint scripts qutebrowser --output-format=colorized --reports=no
|
||||||
@ -138,14 +137,13 @@ commands =
|
|||||||
|
|
||||||
[testenv:pylint-tip]
|
[testenv:pylint-tip]
|
||||||
basepython = python3
|
basepython = python3
|
||||||
skip_install = true
|
|
||||||
setenv = {[testenv:pylint]setenv}
|
|
||||||
passenv = {[testenv:pylint]passenv}
|
passenv = {[testenv:pylint]passenv}
|
||||||
deps =
|
deps =
|
||||||
{[testenv]deps}
|
{[testenv]deps}
|
||||||
{[testenv:misc]deps}
|
{[testenv:misc]deps}
|
||||||
hg+https://bitbucket.org/logilab/astroid
|
hg+https://bitbucket.org/logilab/astroid
|
||||||
hg+https://bitbucket.org/logilab/pylint
|
hg+https://bitbucket.org/logilab/pylint
|
||||||
|
./scripts/dev/pylint_checkers
|
||||||
commands =
|
commands =
|
||||||
{envpython} scripts/link_pyqt.py --tox {envdir}
|
{envpython} scripts/link_pyqt.py --tox {envdir}
|
||||||
{envpython} -m pylint scripts qutebrowser --output-format=colorized --reports=no
|
{envpython} -m pylint scripts qutebrowser --output-format=colorized --reports=no
|
||||||
|
Loading…
Reference in New Issue
Block a user