Skip to content

checks: Pylint 3 config only #327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 32 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
bac5206
Format pyproject.toml
echoix Dec 23, 2024
a571a61
Checks: Add note on MIN_PYTHON_VERSION
echoix Dec 26, 2024
5f934e2
Configure Pyright type checker
echoix Jun 29, 2024
98f6e1b
CQ: Create default pylint config in pyproject.toml
echoix Jun 29, 2024
469e263
CQ: Port root pylint config to pyproject.toml
echoix Jun 29, 2024
ca884d2
CI(pylint): Update versions in workflow
echoix Jun 29, 2024
cf8d4cd
CI: Run Pylint on all project with source-roots configuration and ign…
echoix Dec 23, 2024
fdb535a
CI(pylint): Do not use star glob for wxGUI pylint call
echoix Dec 26, 2024
2b3cbdc
Clear pylint config and reset to defaults
echoix Nov 17, 2024
654face
CQ: Enable pylint plugins
echoix Jul 1, 2024
927f383
Set pylint's output-format to colorized
echoix Nov 23, 2024
d2db3b0
CQ: Set pylint source-roots and ignore-paths
echoix Nov 23, 2024
3e4918f
Checks: Rename pylint rules that were renamed
echoix Dec 25, 2024
9390e45
Checks: Adjust outdated inline pylint exclusions
echoix Dec 26, 2024
95f19a7
Checks: Change pylint folder ignores
echoix Dec 26, 2024
2d32afc
Checks: Disable all failing pylint rules
echoix Dec 26, 2024
f720618
CI(pylint): Remove rcfile argument from pytest pylint call
echoix Dec 26, 2024
00fb797
CI(pylint): Do not change into subdirectory for grass and gui
echoix Dec 26, 2024
265f0bd
CI(pylint): Run pylint on other files before slower wxGUI
echoix Dec 26, 2024
4d92951
CI(pylint): Only run pylint once for all code
echoix Dec 26, 2024
bb7ae7c
checks: Remove non-modified pylint config
echoix Dec 26, 2024
d400722
style: Change misplaced docstring to comment in pygrass/rpc/__init__.py
echoix Jul 7, 2024
31b3100
grass.script: Ignore signature-differs pylint warning in array.py
echoix Jul 7, 2024
6c910a2
grass.imaging.images2gif: Fix Pylint using-constant-test
echoix Aug 12, 2024
8233e57
grass.jupyter.utils: Fix pylint redefined-variable-type (R0204) of ou…
echoix Aug 13, 2024
fdc8614
grass.script.db: Close opened file in db_connection
echoix Aug 24, 2024
800afe4
t.unregister: Open file with context handler (SIM115)
echoix Aug 24, 2024
72bcb48
Typing improvement
echoix Dec 23, 2024
7f17cbd
Fix typo of BufferedMapWindow in gui/wxpython/mapdisp/test_mapdisp.py
echoix Dec 23, 2024
769cfd4
pylint: Add pylint skip-file directive in generated file wxpython/men…
echoix Dec 26, 2024
6de4397
utils: Add timeout to requests.get
echoix Dec 26, 2024
a5b3c56
grass.script.core: Fix E0606: Possibly using variable 'ps' before ass…
echoix Dec 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 23 additions & 21 deletions .github/workflows/python-code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ jobs:

env:
# renovate: datasource=python-version depName=python
PYTHON_VERSION: "3.10"
MIN_PYTHON_VERSION: "3.8"
PYTHON_VERSION: "3.12"
MIN_PYTHON_VERSION: "3.9"
# renovate: datasource=pypi depName=black
BLACK_VERSION: "24.10.0"
# renovate: datasource=pypi depName=flake8
FLAKE8_VERSION: "7.1.1"
# renovate: datasource=pypi depName=pylint
PYLINT_VERSION: "2.12.2"
PYLINT_VERSION: "3.3.2"
# renovate: datasource=pypi depName=bandit
BANDIT_VERSION: "1.8.0"
# renovate: datasource=pypi depName=ruff
Expand Down Expand Up @@ -156,37 +156,39 @@ jobs:
echo "$HOME/install/bin" >> $GITHUB_PATH

- name: Run Pylint on grass package
# Until slower checks (like similarity) are reenabled, running in one step is faster
if: false
run: |
export PYTHONPATH=`grass --config python_path`:$PYTHONPATH
export LD_LIBRARY_PATH=$(grass --config path)/lib:$LD_LIBRARY_PATH
cd python
pylint --persistent=no --py-version=${{ env.MIN_PYTHON_VERSION }} --jobs=$(nproc) grass

- name: Run Pylint on other files using pytest
# Until slower checks (like similarity) are reenabled, running in one step is faster
if: false
run: |
pipx inject --include-apps pylint pytest
pipx inject pylint pytest-pylint pytest-github-actions-annotate-failures pytest-timeout
export PYTHONPATH=`grass --config python_path`:$PYTHONPATH
export LD_LIBRARY_PATH=$(grass --config path)/lib:$LD_LIBRARY_PATH
pytest --pylint -m pylint --pylint-jobs=$(nproc) \
--pylint-ignore-patterns="${{ env.PylintIgnore }}"
env:
PylintIgnore: "python/.*,gui/.*"

- name: Run Pylint on wxGUI
# Until slower checks (like similarity) are reenabled, running in one step is faster
if: false
run: |
export PYTHONPATH=`grass --config python_path`:$PYTHONPATH
export LD_LIBRARY_PATH=$(grass --config path)/lib:$LD_LIBRARY_PATH
cd gui/wxpython
pylint --persistent=no --py-version=${{ env.MIN_PYTHON_VERSION }} --jobs=$(nproc) *
pylint --persistent=no --py-version=${{ env.MIN_PYTHON_VERSION }} --jobs=$(nproc) gui

- name: Run Pylint on other files using pytest
- name: Run Pylint all in one pass
run: |
pipx inject --include-apps pylint pytest==7.4.4
pipx inject pylint pytest-pylint==0.19 pytest-github-actions-annotate-failures
echo "::warning file=.github/workflows/python-code-quality.yml,line=149,col=42,endColumn=48::\
Temporarily downgraded pytest-pylint and pytest to allow merging other PRs.\
The errors reported with a newer version seem legitimite and should be fixed \
(2023-10-18, see https://github.com/OSGeo/grass/pull/3205)\
(2024-01-28, see https://github.com/OSGeo/grass/issues/3380)"
export PYTHONPATH=`grass --config python_path`:$PYTHONPATH
export LD_LIBRARY_PATH=$(grass --config path)/lib:$LD_LIBRARY_PATH
pytest --pylint -m pylint --pylint-rcfile=.pylintrc --pylint-jobs=$(nproc) \
--pylint-ignore-patterns="${{ env.PylintIgnore }}"
env:
PylintIgnore: "python/.*,gui/wxpython/.*,doc/.*,man/.*,utils/.*,locale/.*,raster/.*,\
imagery/.*,scripts/r.in.wms/wms_drv.py,scripts/g.extension/g.extension.py,\
temporal/t.rast.accdetect/t.rast.accdetect.py,temporal/t.rast.accumulate/t.rast.accumulate.py,\
scripts/d.rast.edit/d.rast.edit.py"
pylint --persistent=no --py-version=${{ env.MIN_PYTHON_VERSION }} --jobs=$(nproc) .

- name: Test compiling example modules
run: |
Expand Down
Loading
Loading