Skip to content

Commit

Permalink
Merge branch 'main' into v.to.db
Browse files Browse the repository at this point in the history
  • Loading branch information
echoix authored Aug 15, 2024
2 parents 1c77459 + 0d5d274 commit b0f39bb
Show file tree
Hide file tree
Showing 444 changed files with 7,341 additions and 3,565 deletions.
64 changes: 64 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
[run]
; branch = True
; dynamic_context = test_function
concurrency = multiprocessing,thread
parallel = True
data_file = ${INITIAL_PWD-.}/.coverage
omit =
${INITIAL_PWD-.}/testreport
${INITIAL_PWD-.}/.github/*
${INITIAL_PWD-.}/bin.*/*
${INITIAL_PWD-.}/dist.*/*
**/OBJ.*/*
source =
.
${INITIAL_PWD-.}/
${INITIAL_GISBASE-/usr/local/grass??}/

[paths]
root =
./
${INITIAL_GISBASE-/usr/local/grass??}/
/home/*/install/grass??/
python =
./python/
${INITIAL_GISBASE-/usr/local/grass??}/etc/python/
/home/*/install/grass??/etc/python/
special_d_mon =
./display/d.mon/
${INITIAL_GISBASE-/usr/local/grass??}/etc/d.mon/
/home/*/install/grass??/etc/d.mon/
special_r_in_wms =
./scripts/r.in.wms/
${INITIAL_GISBASE-/usr/local/grass??}/etc/r.in.wms/
/home/*/install/grass??/etc/r.in.wms/


[report]
; Since our file structure isn't an importable package, not all files are found
; This allows to find python files even if there is missing __init__.py files, but is slow
include_namespace_packages = True
skip_covered = False
; Regexes for lines to exclude from consideration
exclude_also =
; Don't complain about missing debug-only code:
def __repr__
if self\.debug

; Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError

; Don't complain if non-runnable code isn't run:
; if 0:
; if __name__ == .__main__.:

; Don't complain about abstract methods, they aren't run:
@(abc\.)?abstractmethod

ignore_errors = True
precision = 2

[html]
directory = coverage_html_report
show_contexts = true
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@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11
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@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11
uses: github/codeql-action/analyze@429e1977040da7a23b6822b13c129cd1ba93dbb2 # v3.26.2
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 @@ -73,7 +73,7 @@ jobs:
sha256sum ${{ env.GRASS }}.tar.xz > ${{ env.GRASS }}.tar.xz.sha256
- name: Publish draft distribution to GitHub (for tags only)
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@a74c6b72af54cfa997e81df42d94703d6313a2d0 # v2.0.6
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # v2.0.8
with:
name: GRASS GIS ${{ github.ref_name }}
body: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,17 @@ jobs:
latest=false
suffix=-${{ matrix.os }}
- name: Set up QEMU
uses: docker/setup-qemu-action@5927c834f5b4fdf503fca6f4c7eccda82949e1ee # v3.1.0
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4fd812986e6c8c2a69e18311145f9371337f27d4 # v3.4.0
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1
- name: Login to DockerHub
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@1a162644f9a7e87d8f4b053101d1d9a712edc18c # v6.3.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@d0e80f58dffbc64f6a3a1f43527d469b4fc7b6c8 # v2.23.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
20 changes: 19 additions & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,21 @@ jobs:
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 \
export INITIAL_GISBASE="$(grass --config path)"
INITIAL_PWD="${PWD}" pytest --verbose --color=yes --durations=0 --durations-min=0.5 \
--cov \
--cov-context=test \
-ra . \
-m 'needs_solo_run'
- name: Fix non-standard installed script paths in coverage data
run: |
export PYTHONPATH=`grass --config python_path`:$PYTHONPATH
export LD_LIBRARY_PATH=$(grass --config path)/lib:$LD_LIBRARY_PATH
export INITIAL_GISBASE="$(grass --config path)"
export INITIAL_PWD="${PWD}"
python utils/coverage_mapper.py
coverage combine
coverage html
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
Expand All @@ -101,6 +112,13 @@ jobs:
flags: pytest-python-${{ matrix.python-version }}
name: pytest-python-${{ matrix.python-version }}
token: ${{ secrets.CODECOV_TOKEN }}
- name: Make python-only code coverage test report available
if: ${{ !cancelled() }}
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: python-codecoverage-report-${{ matrix.os }}-${{ matrix.python-version }}
path: coverage_html_report
retention-days: 1

pytest-success:
name: pytest Result
Expand Down
Loading

0 comments on commit b0f39bb

Please sign in to comment.