Skip to content

Commit

Permalink
Merge branch 'main' into issue_117
Browse files Browse the repository at this point in the history
  • Loading branch information
echoix authored Feb 2, 2025
2 parents b5fbb23 + 09f9235 commit 4127676
Show file tree
Hide file tree
Showing 203 changed files with 3,398 additions and 1,746 deletions.
10 changes: 2 additions & 8 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
ignore =
# whitespace before ':' (Black)
E203,
# E501 line too long
E501,
# line break before binary operator (Black)
W503,

Expand All @@ -25,25 +27,17 @@ per-file-ignores =
gui/wxpython/image2target/g.gui.image2target.py: E501
gui/wxpython/photo2image/g.gui.photo2image.py: E501
gui/wxpython/psmap/*: E501
gui/wxpython/vdigit/*: E722, F405, F403
gui/wxpython/animation/g.gui.animation.py: E501
gui/wxpython/tplot/g.gui.tplot.py: E501
gui/wxpython/iclass/g.gui.iclass.py: E501
gui/wxpython/mapdisp/main.py: E722
gui/wxpython/mapdisp/test_mapdisp.py: E501
gui/wxpython/mapswipe/g.gui.mapswipe.py: E501
gui/wxpython/mapwin/base.py: E722
gui/wxpython/mapwin/buffered.py: E722
gui/wxpython/timeline/g.gui.timeline.py: E501
# Generated file
gui/wxpython/menustrings.py: E501
# C wrappers call libgis.G_gisinit before importing other modules.
# TODO: Is this really needed?
python/grass/jupyter/__init__.py: E501
python/grass/pygrass/vector/__init__.py: E402
# Current benchmarks/tests are changing sys.path before import.
# Possibly, a different approach should be taken there anyway.
python/grass/pygrass/tests/benchmark.py: F821
# Configuration file for Sphinx:
# Ignoring import/code mix and line length.
# Files not managed by Black
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/additional_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
exclude: mswindows .*\.bat .*/testsuite/data/.*

- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: '3.10'

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: '3.x'
- name: Install non-Python dependencies
Expand All @@ -57,7 +57,7 @@ jobs:
if: ${{ matrix.language == 'c-cpp' }}

- name: Initialize CodeQL
uses: github/codeql-action/init@d68b2d4edb4189fd2a5366ac14e72027bd4b37dd # v3.28.2
uses: github/codeql-action/init@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8
with:
languages: ${{ matrix.language }}
config-file: ./.github/codeql/codeql-config.yml
Expand All @@ -82,6 +82,6 @@ jobs:
run: .github/workflows/build_ubuntu-22.04.sh "${HOME}/install"

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@d68b2d4edb4189fd2a5366ac14e72027bd4b37dd # v3.28.2
uses: github/codeql-action/analyze@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8
with:
category: "/language:${{matrix.language}}"
2 changes: 1 addition & 1 deletion .github/workflows/create_release_draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
ref: ${{ github.ref }}
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: '3.11'
- name: Create output directory
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@67a2d409c0a876cbe6b11854e3e25193efe4e62d # v6.12.0
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6.13.0
with:
push: true
pull: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: ${{ matrix.python-version }}
cache: pip
Expand Down Expand Up @@ -117,7 +117,7 @@ jobs:
coverage html
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303 # v5.1.2
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
with:
verbose: true
flags: pytest-python-${{ matrix.python-version }}
Expand Down
33 changes: 12 additions & 21 deletions .github/workflows/python-code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,14 @@ jobs:
# renovate: datasource=python-version depName=python
PYTHON_VERSION: "3.13"
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: "3.3.3"
PYLINT_VERSION: "3.3.4"
# renovate: datasource=pypi depName=bandit
BANDIT_VERSION: "1.8.2"
# renovate: datasource=pypi depName=ruff
RUFF_VERSION: "0.9.2"
RUFF_VERSION: "0.9.4"

runs-on: ${{ matrix.os }}
permissions:
Expand All @@ -59,7 +57,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: pip
Expand All @@ -73,6 +71,14 @@ jobs:
continue-on-error: true
- name: Run Ruff (apply fixes for suggestions)
run: ruff check . --preview --fix --unsafe-fixes
- name: Run `ruff format` showing diff without failing
continue-on-error: true
if: ${{ !cancelled() }}
run: ruff format --diff
- name: Run `ruff format` fixing files
# Run `ruff format` even when `ruff check` fixed files: fixes can require formatting
if: ${{ !cancelled() }}
run: ruff format --diff
- name: Create and uploads code suggestions to apply for Ruff
# Will fail fast here if there are changes required
id: diff-ruff
Expand All @@ -84,21 +90,6 @@ jobs:
# To keep repo's file structure in formatted changes artifact
extra-upload-changes: pyproject.toml

- name: Install Black only
run: pip install black[jupyter]==${{ env.BLACK_VERSION }}

- name: Run Black
run: black .

- name: Create and uploads code suggestions to apply for Black
# Will fail fast here if there are changes required
id: diff-black
uses: ./.github/actions/create-upload-suggestions
with:
tool-name: black
# To keep repo's file structure in formatted changes artifact
extra-upload-changes: .clang-format

- name: Install non-Python dependencies
run: |
sudo apt-get update -y
Expand Down Expand Up @@ -137,7 +128,7 @@ jobs:
path: bandit.sarif

- name: Upload SARIF File into Security Tab
uses: github/codeql-action/upload-sarif@d68b2d4edb4189fd2a5366ac14e72027bd4b37dd # v3.28.2
uses: github/codeql-action/upload-sarif@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8
with:
sarif_file: bandit.sarif

Expand Down
80 changes: 79 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/emacs.desktop
*~
*.lock
!flake.lock
*.pyc
Expand Down Expand Up @@ -68,3 +67,82 @@ lib/*/latex/
.coverage
.coverage.*
coverage.xml

# Created by https://www.toptal.com/developers/gitignore/api/windows,linux,macos
# Edit at https://www.toptal.com/developers/gitignore?templates=windows,linux,macos

### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### macOS Patch ###
# iCloud generated files
*.icloud

### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

# End of https://www.toptal.com/developers/gitignore/api/windows,linux,macos
15 changes: 4 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,17 @@ repos:
)
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.9.2
rev: v0.9.4
hooks:
# Run the linter.
- id: ruff
args: [--fix, --preview]
# Run the formatter.
- id: ruff-format
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.43.0
rev: v0.44.0
hooks:
- id: markdownlint-fix
# Using this mirror lets us use mypyc-compiled black, which is about 2x faster
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.10.0
hooks:
- id: black-jupyter
exclude: |
(?x)^(
python/libgrass_interface_generator/
)
- repo: https://github.com/pycqa/flake8
rev: 7.1.1
hooks:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# syntax=docker/dockerfile:1.12@sha256:93bfd3b68c109427185cd78b4779fc82b484b0b7618e36d0f104d4d801e66d25
# syntax=docker/dockerfile:1.13@sha256:426b85b823c113372f766a963f68cfd9cd4878e1bcc0fda58779127ee98a28eb

# Note: This file must be kept in sync in ./Dockerfile and ./docker/ubuntu/Dockerfile.
# Changes to this file must be copied over to the other file.
Expand Down
1 change: 1 addition & 0 deletions db/db.describe/testsuite/test_dbdescribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
@author: lucadelu
"""

import json

from grass.gunittest.case import TestCase
Expand Down
Loading

0 comments on commit 4127676

Please sign in to comment.