Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/issue_35' into issue_35
Browse files Browse the repository at this point in the history
  • Loading branch information
Shubham Vasudeo Desai committed Sep 19, 2024
2 parents 66ec842 + dc56f61 commit a29f388
Show file tree
Hide file tree
Showing 287 changed files with 4,926 additions and 1,117 deletions.
4 changes: 2 additions & 2 deletions .github/actions/create-upload-suggestions/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ runs:
echo "diff-file-name=${INPUT_DIFF_FILE_NAME}" >> "${GITHUB_OUTPUT}"
env:
INPUT_DIFF_FILE_NAME: ${{ steps.tool-name-safe.outputs.diff-file-name }}
- uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
- uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
id: upload-diff
if: >-
${{ (steps.files_changed.outputs.files_changed == 'true') &&
Expand All @@ -200,7 +200,7 @@ runs:
echo 'Suggestions can only be added near to lines changed in this PR.'
echo 'If any fixes can be added as code suggestions, they will be added shortly from another workflow.'
} >> "${GITHUB_STEP_SUMMARY}"
- uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
- uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
id: upload-changes
if: >-
${{ always() &&
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
persist-credentials: false
- uses: DoozyX/clang-format-lint-action@11b773b1598aa4ae3b32f023701bca5201c3817d # v0.17
- uses: DoozyX/clang-format-lint-action@caa179272c6ee7f1d25dfb503ee0c410c26ebd98 # v0.18.1
with:
source: "."
clangFormatVersion: 17
clangFormatVersion: 18.1.8
inplace: True
- name: Create and uploads code suggestions to apply
id: diff
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
if: ${{ matrix.language == 'c-cpp' }}

- name: Initialize CodeQL
uses: github/codeql-action/init@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15
uses: github/codeql-action/init@429e1977040da7a23b6822b13c129cd1ba93dbb2 # v3.26.2
with:
languages: ${{ matrix.language }}
config-file: ./.github/codeql/codeql-config.yml
Expand All @@ -81,6 +81,6 @@ jobs:
run: .github/workflows/build_ubuntu-22.04.sh "${HOME}/install"

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15
uses: github/codeql-action/analyze@429e1977040da7a23b6822b13c129cd1ba93dbb2 # v3.26.2
with:
category: "/language:${{matrix.language}}"
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@5176d81f87c23d6fc96624dfdbcd9f3830bbe445 # v6.5.0
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
push: true
pull: true
Expand Down
46 changes: 36 additions & 10 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,19 @@ jobs:
- name: Uninstalling Homebrew
run: |
echo "Moving directories..."
sudo mkdir /opt/off
/usr/bin/sudo /usr/bin/find /usr/local /opt/homebrew -mindepth 1 -maxdepth 1 \
-type d -print -exec /bin/mv {} /opt/off/ \;
sudo mkdir /opt/local-off /opt/homebrew-off
test ! -d /usr/local || /usr/bin/sudo /usr/bin/find /usr/local \
-mindepth 1 -maxdepth 1 -type d -print -exec /bin/mv {} \
/opt/local-off/ \;
test ! -d /opt/homebrew || /usr/bin/sudo /usr/bin/find /opt/homebrew \
-mindepth 1 -maxdepth 1 -type d -print -exec /bin/mv {} \
/opt/homebrew-off/ \;
echo "Removing files..."
/usr/bin/sudo /usr/bin/find /usr/local /opt/homebrew -mindepth 1 -maxdepth 1 \
-type f -print -delete
test ! -d /usr/local || /usr/bin/sudo /usr/bin/find /usr/local \
-mindepth 1 -maxdepth 1 -type f -print -delete
test ! -d /opt/homebrew || /usr/bin/sudo /usr/bin/find /opt/homebrew \
-mindepth 1 -maxdepth 1 -type f -print -delete
# Rehash to forget about the deleted files
hash -r
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Setup Mamba
Expand All @@ -55,12 +62,31 @@ jobs:
- name: Add the bin directory to PATH
run: echo "$HOME/install/bin" >> $GITHUB_PATH
- name: Check installed version
if: always()
if: ${{ !cancelled() }}
shell: bash -l {0}
run: source ./.github/workflows/print_versions.sh
- name: Run tests

- name: Run pytest with multiple workers in parallel
shell: bash -el {0}
run: |
export PYTHONPATH=$(grass --config python_path):$PYTHONPATH
export LD_LIBRARY_PATH=$(grass --config path)/lib:$LD_LIBRARY_PATH
pytest --verbose --color=yes --durations=0 --durations-min=0.5 \
--numprocesses auto \
-ra . \
-m 'not needs_solo_run'
- name: Run pytest with a single worker (for tests marked with needs_solo_run)
shell: bash -el {0}
run: >
run: |
export PYTHONPATH=$(grass --config python_path):$PYTHONPATH
export LD_LIBRARY_PATH=$(grass --config path)/lib:$LD_LIBRARY_PATH
pytest --verbose --color=yes --durations=0 --durations-min=0.5 \
-ra . \
-m 'needs_solo_run'
- name: Run gunittest tests
shell: bash -el {0}
run: |
grass --tmp-project XY --exec \
g.download.location url=${{ env.SampleData }} path=$HOME
grass --tmp-project XY --exec \
Expand All @@ -71,8 +97,8 @@ jobs:
SampleData: "https://grass.osgeo.org/sampledata/north_carolina/\
nc_spm_full_v2alpha2.tar.gz"
- name: Make HTML test report available
if: ${{ always() }}
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
if: ${{ !cancelled() }}
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: testreport-macOS
path: testreport
Expand Down
76 changes: 45 additions & 31 deletions .github/workflows/macos_dependencies.txt
Original file line number Diff line number Diff line change
@@ -1,39 +1,53 @@
clang_osx-arm64
clangxx_osx-arm64
setuptools
python
python.app
numpy
gdal
freetype
blas
cairo
matplotlib
pandoc
pillow
six
wxpython
sqlite
jpeg
libpng
libtiff
pkg-config
libiconv
clangxx_osx-arm64
clang_osx-arm64
cmake
fftw
lapack
blas
giflib
proj
flex
freetype
geos
krb5
gettext
lastools
ghostscript
zstd
giflib
git
ipython
krb5
lapack
lastools
libgdal-arrow-parquet
libgdal-core
libgdal-hdf4
libgdal-hdf5
libgdal-netcdf
libgdal-pdf
libgdal-pg
libgdal-postgisraster
libgdal-tiledb
libiconv
libjpeg-turbo
libpng
libsvm
libtiff
llvm-openmp
matplotlib
numpy<2
pandoc
pdal
pillow
pkg-config
ply
postgresql
# postgis>=3.1.4
cmake
llvm-openmp
flex
git
proj
pytest
pytest-github-actions-annotate-failures
pytest-timeout
pytest-xdist
python
python.app
pyyaml
setuptools
six
sqlite
wxpython
zstd
4 changes: 2 additions & 2 deletions .github/workflows/osgeo4w.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: msys2/setup-msys2@5df0ca6cbf14efcd08f8d5bd5e049a3cc8e07fd2 # v2.24.0
- uses: msys2/setup-msys2@ddf331adaebd714795f1042345e6ca57bd66cea8 # v2.24.1
with:
path-type: inherit
location: D:\
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:

- name: Make HTML test report available
if: ${{ always() }}
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: testreport-${{ matrix.os }}
path: testreport
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Make python-only code coverage test report available
if: ${{ !cancelled() }}
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: python-codecoverage-report-${{ matrix.os }}-${{ matrix.python-version }}
path: coverage_html_report
Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/python-code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ jobs:
PYTHON_VERSION: "3.10"
MIN_PYTHON_VERSION: "3.8"
# renovate: datasource=pypi depName=black
BLACK_VERSION: "24.4.2"
BLACK_VERSION: "24.8.0"
# renovate: datasource=pypi depName=flake8
FLAKE8_VERSION: "7.1.0"
FLAKE8_VERSION: "7.1.1"
# renovate: datasource=pypi depName=pylint
PYLINT_VERSION: "2.12.2"
# renovate: datasource=pypi depName=bandit
BANDIT_VERSION: "1.7.9"
# renovate: datasource=pypi depName=ruff
RUFF_VERSION: "0.5.5"
RUFF_VERSION: "0.5.7"

runs-on: ${{ matrix.os }}
permissions:
Expand Down Expand Up @@ -66,8 +66,11 @@ jobs:

- name: Install Ruff
run: pip install ruff==${{ env.RUFF_VERSION }}
- name: Run Ruff
run: ruff check --output-format=github . --preview --fix --unsafe-fixes
- name: Run Ruff (output annotations on fixable errors)
run: ruff check --output-format=github . --preview --unsafe-fixes
continue-on-error: true
- name: Run Ruff (apply fixes for suggestions)
run: ruff check . --preview --fix --unsafe-fixes
- name: Create and uploads code suggestions to apply for Ruff
# Will fail fast here if there are changes required
id: diff-ruff
Expand Down Expand Up @@ -126,13 +129,13 @@ jobs:
bandit -c pyproject.toml -iii -r . -f sarif -o bandit.sarif --exit-zero
- name: Upload Bandit Scan Results
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: bandit.sarif
path: bandit.sarif

- name: Upload SARIF File into Security Tab
uses: github/codeql-action/upload-sarif@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15
uses: github/codeql-action/upload-sarif@429e1977040da7a23b6822b13c129cd1ba93dbb2 # v3.26.2
with:
sarif_file: bandit.sarif

Expand Down Expand Up @@ -198,7 +201,7 @@ jobs:
cp -rp dist.$ARCH/docs/html/libpython sphinx-grass
- name: Make Sphinx documentation available
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: sphinx-grass
path: sphinx-grass
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/super-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
# list of files that changed across commits
fetch-depth: 0
- name: Lint code base
uses: super-linter/super-linter/slim@3fe03abab2eafb293ace16d4a3b07aeabcb3f1a0 # v6.7.0
uses: super-linter/super-linter/slim@1fa6ba58a88783e9714725cf89ac26d53e80c148 # v6.9.0
env:
DEFAULT_BRANCH: main
# To report GitHub Actions status checks
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ jobs:

- name: Make HTML test report available
if: ${{ always() }}
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: testreport-${{ matrix.os }}-${{ matrix.config }}-${{ matrix.extra-include }}
path: testreport
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ repos:
)
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.5.5
rev: v0.5.7
hooks:
# Run the linter.
- id: ruff
Expand All @@ -49,15 +49,15 @@ repos:
- 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.4.2
rev: 24.8.0
hooks:
- id: black-jupyter
exclude: |
(?x)^(
python/libgrass_interface_generator/
)
- repo: https://github.com/pycqa/flake8
rev: 7.1.0
rev: 7.1.1
hooks:
- id: flake8
exclude: |
Expand All @@ -66,7 +66,7 @@ repos:
.*/testsuite/.*
)
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v17.0.6
rev: v18.1.8
hooks:
- id: clang-format
types_or: [c, c++, javascript, json, objective-c]
Expand Down
2 changes: 1 addition & 1 deletion display/d.colortable/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ int main(int argc, char **argv)
if (atcat > (int)dmax)
break;
} /* col loop */
} /* int map */
} /* int map */

else {

Expand Down
2 changes: 1 addition & 1 deletion display/d.histogram/bar.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ int bar(struct stat_list *dist_stats, /* list of distribution statistics */
y_box[1] = y_box[2] = bar_height;
D_polygon_abs(x_box, y_box, 4);
}
} /* fp */
} /* fp */
else { /* 1-color bar for int data or null */

D_color((CELL)bar_color, colors);
Expand Down
2 changes: 1 addition & 1 deletion display/d.text/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def text(in_text):

for i in range(36):
font(fonts[int(i % len(fonts))])
size((36 - i if (i >= 9 and i <= 18 or i > 27) else i) % 9)
size((36 - i if ((i >= 9 and i <= 18) or i > 27) else i) % 9)
rotate(i * 10)
color(colors[i % len(colors)])
xy(
Expand Down
Loading

0 comments on commit a29f388

Please sign in to comment.