Commit 3dec636c authored by Jérome Perrin's avatar Jérome Perrin

pylint

parent fa9e2aff
......@@ -15,4 +15,4 @@
[template]
filename = instance.cfg
md5sum = 597c29546519aabe7259e416d0b92095
md5sum = f07a5d7e90a99a28e1dd32df23dee755
......@@ -82,6 +82,37 @@ repository = ${slapos.rebootstrap-repository:location}
<= download-source
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]
recipe = slapos.recipe.template:jinja2
......@@ -93,6 +124,7 @@ template = inline:
export SLAPOS_TEST_EGGS_DIRECTORY=$${buildout:eggs-directory}
export SLAPOS_TEST_DEVELOP_EGGS_DIRECTORY=$${buildout:develop-eggs-directory}
export SLAPOS_TEST_POSTGRESQL_PREFIX=${postgresql:location}
export PYLINTRC=$${default-pylintrc:rendered}
[slapos-test-runner-dot-nxdtest]
......@@ -100,25 +132,48 @@ recipe = slapos.recipe.template:jinja2
rendered = $${:workdir}/.nxdtest
workdir = $${create-directory:nxdtest-working-dir}
template = inline:
template =
inline:
import sys
TestCase(
"kedifa",
['python', '-m', 'unittest', 'discover', '-v'],
cwd="""$${kedifa:location}""",
summaryf=UnitTest.summary,
)
if sys.version_info >= (3, ):
TestCase(
"kedifa:pylint",
['python', '-m', 'pylint', 'kedifa'],
cwd="""$${kedifa:location}""",
summaryf=PyLint.summary,
)
TestCase(
"caucase",
['$${caucase-test-runner:rendered}'],
cwd="""$${caucase:location}""",
summaryf=UnitTest.summary,
)
if sys.version_info >= (3, ):
TestCase(
"caucase:pylint",
['python', '-m', 'pylint', 'caucase'],
cwd="""$${caucase:location}""",
summaryf=PyLint.summary,
)
TestCase(
"erp5.util",
['python', '-m', 'unittest', 'discover', '-v', '--start', 'erp5/tests/'],
cwd="""$${erp5.util:location}""",
summaryf=UnitTest.summary,
)
if sys.version_info >= (3, ):
TestCase(
"erp5.util:pylint",
['python', '-m', 'pylint', 'erp5'],
cwd="""$${erp5.util:location}""",
summaryf=PyLint.summary,
)
TestCase(
"slapos.cookbook",
# slapos/test contain both tests for recipes and tests for
......@@ -128,6 +183,13 @@ template = inline:
cwd="""$${slapos.cookbook:location}""",
summaryf=UnitTest.summary,
)
if sys.version_info >= (3, ):
TestCase(
"slapos.cookbook:pylint",
['python', '-m', 'pylint', 'slapos'],
cwd="""$${slapos.cookbook:location}""",
summaryf=PyLint.summary,
)
TestCase(
"slapos.core",
# ['python', '-m', 'unittest', 'discover', '-v'],
......@@ -138,18 +200,39 @@ template = inline:
cwd="""$${slapos.core:location}""",
summaryf=UnitTest.summary,
)
if sys.version_info >= (3, ):
TestCase(
"slapos.core:pylint",
['python', '-m', 'pylint', 'slapos'],
cwd="""$${slapos.core:location}""",
summaryf=PyLint.summary,
)
TestCase(
"slapos.recipe.build",
['python', '-m', 'unittest', 'discover', '-v'],
cwd="""$${slapos.recipe.build:location}""",
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(
"slapos.recipe.cmmi",
['python', '-m', 'unittest', 'discover', '-v'],
cwd="""$${slapos.recipe.cmmi:location}""",
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(
"slapos.recipe.template",
# ['python', '-m', 'unittest', 'slapos.recipe.template.tests.test_suite'],
......@@ -158,6 +241,13 @@ template = inline:
cwd="""$${slapos.recipe.template:location}""",
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(
"slapos.toolbox",
# ['python', '-m', 'unittest', 'discover', '-v'],
......@@ -171,24 +261,52 @@ template = inline:
cwd="""$${slapos.toolbox:location}""",
summaryf=UnitTest.summary,
)
if sys.version_info >= (3, ):
TestCase(
"slapos.toolbox:pylint",
['python', '-m', 'pylint', 'slapos'],
cwd="""$${slapos.toolbox:location}""",
summaryf=PyLint.summary,
)
TestCase(
"slapos.libnetworkcache",
['python', '-m', 'unittest', '-v', 'slapos.libnetworkcachetests'],
cwd="""$${slapos.libnetworkcache:location}""",
summaryf=UnitTest.summary,
)
if sys.version_info >= (3, ):
TestCase(
"slapos.libnetworkcache:pylint",
['python', '-m', 'pylint', 'slapos'],
cwd="""$${slapos.libnetworkcache:location}""",
summaryf=PyLint.summary,
)
TestCase(
"slapos.rebootstrap",
['python', '-m', 'unittest', '-v', 'slapos.rebootstrap.tests.test_suite'],
cwd="""$${slapos.rebootstrap:location}""",
summaryf=UnitTest.summary,
)
if sys.version_info >= (3, ):
TestCase(
"slapos.rebootstrap:pylint",
['python', '-m', 'pylint', 'slapos'],
cwd="""$${slapos.rebootstrap:location}""",
summaryf=PyLint.summary,
)
TestCase(
"rubygemsrecipe",
['python', '-m', 'unittest', 'discover', '-v'],
cwd="""$${rubygemsrecipe:location}""",
summaryf=UnitTest.summary,
)
if sys.version_info >= (3, ):
TestCase(
"rubygemsrecipe:pylint",
['python', '-m', 'pylint', 'rubygemsrecipe'],
cwd="""$${rubygemsrecipe:location}""",
summaryf=UnitTest.summary,
)
[runTestSuite]
env.sh = $${slapos-test-runner-nxdtest-environment.sh:rendered}
......
......@@ -4,3 +4,26 @@ extends =
[python]
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 =
../../component/userhosts/buildout.cfg
../../component/postgresql/buildout.cfg
../../component/psycopg2/buildout.cfg
../../component/pylint/buildout.cfg
../../stack/slapos.cfg
../../stack/caucase/buildout.cfg
../../stack/nxdtest.cfg
......@@ -127,6 +128,7 @@ eggs +=
${backports.lzma:egg}
${pycurl:egg}
${bcrypt:egg}
${pylint:egg}
dnspython
Jinja2
${kedifa-setup:egg}
......@@ -150,6 +152,7 @@ eggs = ${eggs:eggs}
scripts =
slapos
supervisord
pylint
[git-clone-repository]
recipe = slapos.recipe.build:gitclone
......@@ -255,5 +258,10 @@ pycurl = 7.43.0.2
pyflakes = 2.0.0
zope.testing = 4.6.2
urllib3 = 1.24.1
pathlib = 1.0.1
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