Skip to content
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

checks: Pylint 3 config #143

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
e47bd56
CQ: Create default pylint config in pyproject.toml
echoix Jun 29, 2024
2e4f39c
CQ: Port root pylint config to pyproject.toml
echoix Jun 29, 2024
f14ed17
DEBUG: Reorder old root pylintrc file
echoix Jun 29, 2024
46e3cf3
DEBUG: Readd old pylintrc files
echoix Jun 29, 2024
0a4432d
DEBUG: Configure Pyright type checker
echoix Jun 29, 2024
b0d3788
CI(pylint): Update versions in workflow
echoix Jun 29, 2024
9eb292c
CQ: Enable pylint plugins redefined_variable_type and bad_builtin
echoix Jul 1, 2024
cbe98eb
CQ: Disable pylint plugin bad_builtin
echoix Jul 1, 2024
2df925c
style: Change misplaced docstring to comment in pygrass/rpc/__init__.py
echoix Jul 7, 2024
0f24b77
grass.script: Ignore signature-differs pylint warning in array.py
echoix Jul 7, 2024
7bcc4e8
DEBUG: Do not fail pylint to run all steps, then rerun pylint with fa…
echoix Jul 8, 2024
d66170f
grass.imaging.images2gif: Fix Pylint using-constant-test
echoix Aug 12, 2024
9d0e7a2
grass.jupyter.utils: Fix pylint redefined-variable-type (R0204) of ou…
echoix Aug 13, 2024
be09d3f
grass.script.db: Close opened file in db_connection
echoix Aug 24, 2024
94471d5
t.unregister: Open file with context handler (SIM115)
echoix Aug 24, 2024
4638e0c
DEBUG: Clear pylint config
echoix Nov 17, 2024
1692fab
DEBUG: Set GRASS-specific overrides and comment out defaults
echoix Nov 17, 2024
0075177
Set pylint's output-format to colorized
echoix Nov 23, 2024
2580f00
CQ: Set pylint ignore-paths to ignore libgrass_interface_generator an…
echoix Nov 23, 2024
9af2cfa
DEBUG: Try configuring pylint per-file ignores with a plugin
echoix Nov 23, 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
46 changes: 36 additions & 10 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.1"
# renovate: datasource=pypi depName=bandit
BANDIT_VERSION: "1.7.10"
# renovate: datasource=pypi depName=ruff
Expand Down Expand Up @@ -156,28 +156,26 @@ jobs:
echo "$HOME/install/bin" >> $GITHUB_PATH

- name: Run Pylint on grass package
continue-on-error: true # DEBUG
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 wxGUI
continue-on-error: true # DEBUG
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) *

- name: Run Pylint on other files using pytest
continue-on-error: true # DEBUG
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)"
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-rcfile=.pylintrc --pylint-jobs=$(nproc) \
Expand Down Expand Up @@ -207,6 +205,34 @@ jobs:
path: sphinx-grass
retention-days: 3

- name: Run Pylint on grass package
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 wxGUI
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) *

- name: Run Pylint on other files using pytest
run: |
pipx inject --include-apps pylint pytest
pipx inject pylint pytest-pylint= pytest-github-actions-annotate-failures
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"

python-success:
name: Python Code Quality Result
needs:
Expand Down
Loading
Loading