Skip to content

Commit 6166175

Browse files
crasbemaribu
authored andcommitted
workflows,tox: disable warning for new pylints
Starting from the pylint version that is pulled with Python 3.9, it checks for the amount of positional arguments in a function. The __init__ function has too many and the warning can only be disabled for newer versions, therefore tox has to conditionally check it.
1 parent 8780970 commit 6166175

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

.github/workflows/tox.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Test with tox
3333
run: |
3434
pyenv="py$(echo "${{ matrix.python-version }}" | tr -d '.')"
35-
tox -e ${pyenv}-test,${pyenv}-rapidjson,flake8,lint
35+
tox -e ${pyenv}-test,${pyenv}-rapidjson,flake8,${pyenv}-lint
3636
- name: Check code format with black
3737
if: matrix.python-version == '3.9'
3838
run: tox -e black

tox.ini

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = {py35,py36,py37,py38,py39,py310,py311,py312}-{test,rapidjson},lint,flake8,check_package,black
2+
envlist = py3{5,6,7,8,9,10,11,12}-{test,rapidjson,lint},flake8,check_package,black
33
skip_missing_interpreters = true
44

55
[testenv]
@@ -37,12 +37,22 @@ deps =
3737
commands =
3838
pytest -m "rapidjson" {posargs}
3939

40-
[testenv:lint]
40+
[testenv:py3{5,6,7,8}-lint]
4141
deps =
4242
pylint
4343
pytest
4444
commands =
4545
pylint --rcfile=setup.cfg {envsitepackagesdir}/{env:package}
46+
# This does not check files in 'tests/utils/applications'
47+
48+
[testenv:py3{9,10,11,12}-lint]
49+
deps =
50+
pylint
51+
pytest
52+
commands =
53+
# older pylint versions are incompatible with `too-many-positional-arguments`,
54+
# therefore it can not be added to the setup.cfg
55+
pylint --disable=too-many-positional-arguments --rcfile=setup.cfg {envsitepackagesdir}/{env:package}
4656
# This does not check files in 'tests/utils/application'
4757

4858
[testenv:{build,clean}]

0 commit comments

Comments
 (0)