Commit d6640e08 authored by Jérome Perrin's avatar Jérome Perrin

pylint

parent 2d19a4be
...@@ -15,4 +15,4 @@ ...@@ -15,4 +15,4 @@
[template] [template]
filename = instance.cfg filename = instance.cfg
md5sum = ba6c572678687081ce111d3805be3cee md5sum = a073f55bc315f7046b88ad9971cf04fc
...@@ -82,6 +82,37 @@ repository = ${slapos.rebootstrap-repository:location} ...@@ -82,6 +82,37 @@ repository = ${slapos.rebootstrap-repository:location}
<= download-source <= download-source
repository = ${rubygemsrecipe-repository:location} repository = ${rubygemsrecipe-repository:location}
[default-pylintrc]
recipe = slapos.recipe.template:jinja2
rendered = $${create-directory:etc}/$${:_buildout_section_name_}
template =
inline:
[REPORTS]
reports = no
score = no
# TODO: this is output format during development
output-format = colorized
[MESSAGES CONTROL]
disable =
W,
R,
C,
I,
no-member # TODO enable all E
enable =
assert-on-tuple,
duplicate-key,
logging-not-lazy,
mixed-indentation,
unused-variable,
unused-import,
redundant-unittest-assert
[TYPECHECK]
# XXX can we do better than this ?
ignored-modules = zc, zope
[slapos-test-runner-nxdtest-environment.sh] [slapos-test-runner-nxdtest-environment.sh]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
...@@ -93,6 +124,7 @@ template = inline: ...@@ -93,6 +124,7 @@ template = inline:
export SLAPOS_TEST_EGGS_DIRECTORY=$${buildout:eggs-directory} export SLAPOS_TEST_EGGS_DIRECTORY=$${buildout:eggs-directory}
export SLAPOS_TEST_DEVELOP_EGGS_DIRECTORY=$${buildout:develop-eggs-directory} export SLAPOS_TEST_DEVELOP_EGGS_DIRECTORY=$${buildout:develop-eggs-directory}
export SLAPOS_TEST_POSTGRESQL_PREFIX=${postgresql:location} export SLAPOS_TEST_POSTGRESQL_PREFIX=${postgresql:location}
export PYLINTRC=$${default-pylintrc:rendered}
[slapos-test-runner-dot-nxdtest] [slapos-test-runner-dot-nxdtest]
...@@ -100,25 +132,48 @@ recipe = slapos.recipe.template:jinja2 ...@@ -100,25 +132,48 @@ recipe = slapos.recipe.template:jinja2
rendered = $${:workdir}/.nxdtest rendered = $${:workdir}/.nxdtest
workdir = $${create-directory:nxdtest-working-dir} workdir = $${create-directory:nxdtest-working-dir}
template = inline: template =
inline:
import sys
TestCase( TestCase(
"kedifa", "kedifa",
['python', '-m', 'unittest', 'discover', '-v'], ['python', '-m', 'unittest', 'discover', '-v'],
cwd="""$${kedifa:location}""", cwd="""$${kedifa:location}""",
summaryf=UnitTest.summary, summaryf=UnitTest.summary,
) )
if sys.version_info >= (3, ):
TestCase(
"kedifa:pylint",
['python', '-m', 'pylint', 'kedifa'],
cwd="""$${kedifa:location}""",
summaryf=PyLint.summary,
)
TestCase( TestCase(
"caucase", "caucase",
['$${caucase-test-runner:rendered}'], ['$${caucase-test-runner:rendered}'],
cwd="""$${caucase:location}""", cwd="""$${caucase:location}""",
summaryf=UnitTest.summary, summaryf=UnitTest.summary,
) )
if sys.version_info >= (3, ):
TestCase(
"caucase:pylint",
['python', '-m', 'pylint', 'caucase'],
cwd="""$${caucase:location}""",
summaryf=PyLint.summary,
)
TestCase( TestCase(
"erp5.util", "erp5.util",
['python', '-m', 'unittest', 'discover', '-v', '--start', 'erp5/tests/'], ['python', '-m', 'unittest', 'discover', '-v', '--start', 'erp5/tests/'],
cwd="""$${erp5.util:location}""", cwd="""$${erp5.util:location}""",
summaryf=UnitTest.summary, summaryf=UnitTest.summary,
) )
if sys.version_info >= (3, ):
TestCase(
"erp5.util:pylint",
['python', '-m', 'pylint', 'erp5'],
cwd="""$${erp5.util:location}""",
summaryf=PyLint.summary,
)
TestCase( TestCase(
"slapos.cookbook", "slapos.cookbook",
# slapos/test contain both tests for recipes and tests for # slapos/test contain both tests for recipes and tests for
...@@ -128,6 +183,13 @@ template = inline: ...@@ -128,6 +183,13 @@ template = inline:
cwd="""$${slapos.cookbook:location}""", cwd="""$${slapos.cookbook:location}""",
summaryf=UnitTest.summary, summaryf=UnitTest.summary,
) )
if sys.version_info >= (3, ):
TestCase(
"slapos.cookbook:pylint",
['python', '-m', 'pylint', 'slapos'],
cwd="""$${slapos.cookbook:location}""",
summaryf=PyLint.summary,
)
TestCase( TestCase(
"slapos.core", "slapos.core",
# ['python', '-m', 'unittest', 'discover', '-v'], # ['python', '-m', 'unittest', 'discover', '-v'],
...@@ -138,18 +200,39 @@ template = inline: ...@@ -138,18 +200,39 @@ template = inline:
cwd="""$${slapos.core:location}""", cwd="""$${slapos.core:location}""",
summaryf=UnitTest.summary, summaryf=UnitTest.summary,
) )
if sys.version_info >= (3, ):
TestCase(
"slapos.core:pylint",
['python', '-m', 'pylint', 'slapos'],
cwd="""$${slapos.core:location}""",
summaryf=PyLint.summary,
)
TestCase( TestCase(
"slapos.recipe.build", "slapos.recipe.build",
['python', '-m', 'unittest', 'discover', '-v'], ['python', '-m', 'unittest', 'discover', '-v'],
cwd="""$${slapos.recipe.build:location}""", cwd="""$${slapos.recipe.build:location}""",
summaryf=UnitTest.summary, summaryf=UnitTest.summary,
) )
if sys.version_info >= (3, ):
TestCase(
"slapos.recipe.build:pylint",
['python', '-m', 'pylint', 'slapos'],
cwd="""$${slapos.recipe.build:location}""",
summaryf=PyLint.summary,
)
TestCase( TestCase(
"slapos.recipe.cmmi", "slapos.recipe.cmmi",
['python', '-m', 'unittest', 'discover', '-v'], ['python', '-m', 'unittest', 'discover', '-v'],
cwd="""$${slapos.recipe.cmmi:location}""", cwd="""$${slapos.recipe.cmmi:location}""",
summaryf=UnitTest.summary, summaryf=UnitTest.summary,
) )
if sys.version_info >= (3, ):
TestCase(
"slapos.recipe.cmmi:pylint",
['python', '-m', 'pylint', 'slapos'],
cwd="""$${slapos.recipe.cmmi:location}""",
summaryf=PyLint.summary,
)
TestCase( TestCase(
"slapos.recipe.template", "slapos.recipe.template",
# ['python', '-m', 'unittest', 'slapos.recipe.template.tests.test_suite'], # ['python', '-m', 'unittest', 'slapos.recipe.template.tests.test_suite'],
...@@ -158,6 +241,13 @@ template = inline: ...@@ -158,6 +241,13 @@ template = inline:
cwd="""$${slapos.recipe.template:location}""", cwd="""$${slapos.recipe.template:location}""",
summaryf=UnitTest.summary, summaryf=UnitTest.summary,
) )
if sys.version_info >= (3, ):
TestCase(
"slapos.recipe.template:pylint",
['python', '-m', 'pylint', 'slapos'],
cwd="""$${slapos.recipe.template:location}""",
summaryf=PyLint.summary,
)
TestCase( TestCase(
"slapos.toolbox", "slapos.toolbox",
# ['python', '-m', 'unittest', 'discover', '-v'], # ['python', '-m', 'unittest', 'discover', '-v'],
...@@ -171,24 +261,52 @@ template = inline: ...@@ -171,24 +261,52 @@ template = inline:
cwd="""$${slapos.toolbox:location}""", cwd="""$${slapos.toolbox:location}""",
summaryf=UnitTest.summary, summaryf=UnitTest.summary,
) )
if sys.version_info >= (3, ):
TestCase(
"slapos.toolbox:pylint",
['python', '-m', 'pylint', 'slapos'],
cwd="""$${slapos.toolbox:location}""",
summaryf=PyLint.summary,
)
TestCase( TestCase(
"slapos.libnetworkcache", "slapos.libnetworkcache",
['python', '-m', 'unittest', '-v', 'slapos.libnetworkcachetests'], ['python', '-m', 'unittest', '-v', 'slapos.libnetworkcachetests'],
cwd="""$${slapos.libnetworkcache:location}""", cwd="""$${slapos.libnetworkcache:location}""",
summaryf=UnitTest.summary, summaryf=UnitTest.summary,
) )
if sys.version_info >= (3, ):
TestCase(
"slapos.libnetworkcache:pylint",
['python', '-m', 'pylint', 'slapos'],
cwd="""$${slapos.libnetworkcache:location}""",
summaryf=PyLint.summary,
)
TestCase( TestCase(
"slapos.rebootstrap", "slapos.rebootstrap",
['python', '-m', 'unittest', '-v', 'slapos.rebootstrap.tests.test_suite'], ['python', '-m', 'unittest', '-v', 'slapos.rebootstrap.tests.test_suite'],
cwd="""$${slapos.rebootstrap:location}""", cwd="""$${slapos.rebootstrap:location}""",
summaryf=UnitTest.summary, summaryf=UnitTest.summary,
) )
if sys.version_info >= (3, ):
TestCase(
"slapos.rebootstrap:pylint",
['python', '-m', 'pylint', 'slapos'],
cwd="""$${slapos.rebootstrap:location}""",
summaryf=PyLint.summary,
)
TestCase( TestCase(
"rubygemsrecipe", "rubygemsrecipe",
['python', '-m', 'unittest', 'discover', '-v'], ['python', '-m', 'unittest', 'discover', '-v'],
cwd="""$${rubygemsrecipe:location}""", cwd="""$${rubygemsrecipe:location}""",
summaryf=UnitTest.summary, summaryf=UnitTest.summary,
) )
if sys.version_info >= (3, ):
TestCase(
"rubygemsrecipe:pylint",
['python', '-m', 'pylint', 'rubygemsrecipe'],
cwd="""$${rubygemsrecipe:location}""",
summaryf=UnitTest.summary,
)
[runTestSuite] [runTestSuite]
env.sh = $${slapos-test-runner-nxdtest-environment.sh:rendered} env.sh = $${slapos-test-runner-nxdtest-environment.sh:rendered}
......
...@@ -4,3 +4,26 @@ extends = ...@@ -4,3 +4,26 @@ extends =
[python] [python]
part = python3 part = python3
[pylint]
patches =
depends = ${mccabe:egg}
[mccabe]
recipe = zc.recipe.egg:custom
egg = mccabe
setup-eggs = pytest-runner
[versions:python3]
pylint = 2.12.1
typing-extensions = 4.0.0:whl
toml = 0.10.2
mccabe = 0.6.1
isort = 5.10.1
astroid = 2.9.0
platformdirs = 2.4.0:whl
typed-ast = 1.5.0
wrapt = 1.13.3
lazy-object-proxy = 1.6.0
...@@ -19,6 +19,7 @@ extends = ...@@ -19,6 +19,7 @@ extends =
../../component/userhosts/buildout.cfg ../../component/userhosts/buildout.cfg
../../component/postgresql/buildout.cfg ../../component/postgresql/buildout.cfg
../../component/psycopg2/buildout.cfg ../../component/psycopg2/buildout.cfg
../../component/pylint/buildout.cfg
../../stack/slapos.cfg ../../stack/slapos.cfg
../../stack/caucase/buildout.cfg ../../stack/caucase/buildout.cfg
../../stack/nxdtest.cfg ../../stack/nxdtest.cfg
...@@ -128,6 +129,7 @@ eggs += ...@@ -128,6 +129,7 @@ eggs +=
${backports.lzma:egg} ${backports.lzma:egg}
${pycurl:egg} ${pycurl:egg}
${bcrypt:egg} ${bcrypt:egg}
${pylint:egg}
dnspython dnspython
Jinja2 Jinja2
${kedifa-setup:egg} ${kedifa-setup:egg}
...@@ -151,6 +153,7 @@ eggs = ${eggs:eggs} ...@@ -151,6 +153,7 @@ eggs = ${eggs:eggs}
scripts = scripts =
slapos slapos
supervisord supervisord
pylint
[git-clone-repository] [git-clone-repository]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
...@@ -256,5 +259,10 @@ pycurl = 7.43.0.2 ...@@ -256,5 +259,10 @@ pycurl = 7.43.0.2
pyflakes = 2.0.0 pyflakes = 2.0.0
zope.testing = 4.6.2 zope.testing = 4.6.2
urllib3 = 1.24.1 urllib3 = 1.24.1
pathlib = 1.0.1
psycopg2 = 2.8.6 psycopg2 = 2.8.6
[versions:python2]
pylint = 1.4.4
astroid = 1.3.8
logilab-common = 1.3.0
pathlib = 1.0.1
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment