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

CI/CD updates and cleanup #14

Merged
merged 49 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
13091fb
v.out.ogr: Add basic unit tests (#3848)
ldesousa Jul 31, 2024
c88fc0f
grass.pydispatch: Apply code changes from upstream pydispatcher repo …
echoix Aug 1, 2024
17474a9
r3.in.v5d: Remove unused variables (#4114)
ShubhamDesai Aug 2, 2024
e671a43
i.ortho.photo: Fix uninitialized variable and potential buffer overfl…
ShubhamDesai Aug 2, 2024
6dbd5d1
r.out.mpeg: Fix buffer overflow issues by replacing sprintf with snpr…
ShubhamDesai Aug 2, 2024
9cebe70
r.path: Fix buffer overflow check issue (#4087)
ShubhamDesai Aug 2, 2024
85498f4
lib/vector: new functions for setting trim of GEOS WKT output (#4123)
nilason Aug 2, 2024
0c8b6de
lib/init: add GRASS_CONFIG_DIR environment variable (#3899)
imincik Aug 2, 2024
ae2281e
CI(deps): Update actions/upload-artifact action to v4.3.5 (#4125)
renovate[bot] Aug 2, 2024
a342ea8
CI: update macOS runner dependencies (#4120)
nilason Aug 2, 2024
cbc8fd5
grass.pygrass: remove unused arg in ctypes.CFUNCTYPE (#4113)
mshukuno Aug 2, 2024
7f17695
CI(deps): Update dependency black to v24.8.0 (#4128)
renovate[bot] Aug 2, 2024
a990091
style: Revert "style: Fixes some unnecessary-lambda (PLW0108) (#3956)…
echoix Aug 3, 2024
31b2bec
CI(deps): Update ruff to v0.5.6 (#4126)
renovate[bot] Aug 3, 2024
6a3da77
docker: define GISBASE for Alpine (#4130)
landam Aug 4, 2024
c53c938
CI(deps): Update msys2/setup-msys2 action to v2.24.1 (#4129)
renovate[bot] Aug 4, 2024
ba78f6f
style: Fix unnecessary-placeholder (PIE790) (#4132)
echoix Aug 4, 2024
186f319
style: Fix useless-import-alias (PLC0414) (#4133)
echoix Aug 4, 2024
1d98e3c
CI(deps): Update flake8 to v7.1.1 (#4135)
renovate[bot] Aug 5, 2024
afdb4db
CI(deps): Lock file maintenance (#4136)
renovate[bot] Aug 5, 2024
0496add
g.findfile: fix potential buffer overflow (#4056)
ShubhamDesai Aug 5, 2024
eb9bda6
i.smap: fix sizeof not portable issue (#4060)
ShubhamDesai Aug 5, 2024
ba3476d
i.aster.toar: fix potential buffer overflows (#4079)
ShubhamDesai Aug 5, 2024
f9f7482
CI(deps): Lock file maintenance (#4140)
renovate[bot] Aug 5, 2024
e87f788
lib/gis: Add a helper function to determine the number of threads for…
cyliang368 Aug 5, 2024
57db287
grass.jupyter: Add Parallelization to TimeSeriesMap and SeriesMap (#4…
29riyasaxena Aug 5, 2024
32de21b
r.report: add JSON support (#3935)
kritibirda26 Aug 5, 2024
7f7f0ef
CI(deps): Update pre-commit hook psf/black-pre-commit-mirror to v24.8…
renovate[bot] Aug 6, 2024
39d3f87
r.texture: control the number of threads (#3917)
cyliang368 Aug 6, 2024
47b03d1
r.horizon: Support parallel computing for the raster mode by OpenMP (…
cyliang368 Aug 6, 2024
1527322
CI(deps): Update github/codeql-action action to v3.26.0 (#4146)
renovate[bot] Aug 6, 2024
1295745
style: Fix extraneous-parentheses (UP034) (#4144)
echoix Aug 7, 2024
eaee7b8
CI(deps): Update docker/build-push-action action to v6.6.0 (#4148)
renovate[bot] Aug 7, 2024
51bc2c3
style: Fix dict-index-missing-items (PLC0206) (#4138)
echoix Aug 7, 2024
0446123
style: Fix parenthesize-chained-operators (RUF021) (#4145)
echoix Aug 7, 2024
d3fa0fb
CI(deps): Update docker/build-push-action action to v6.6.1 (#4152)
renovate[bot] Aug 7, 2024
8c22a55
grass.jupyter: Allow users to draw simple geometries and save it as v…
29riyasaxena Aug 8, 2024
fa781d7
r.out.mpeg: Fix potential buffer overflow issue (#4088)
ShubhamDesai Aug 8, 2024
c132d68
lib/vector: fix potential buffer overflow (#4149)
ShubhamDesai Aug 8, 2024
ff83f69
r.in.xyz: Fix uninitialized variables (#4150)
ShubhamDesai Aug 8, 2024
3cc6897
t.rast.accumulate: Remove check of non-existing `range` option (#4154)
echoix Aug 8, 2024
16c5bf9
grass.jupyter: Add Query Button to InteractiveMap (#3793)
29riyasaxena Aug 9, 2024
1953975
style: Fix self-assigning-variable (PLW0127) (#4137)
echoix Aug 9, 2024
f2c8cd9
style: Fix non-augmented-assignment (PLR6104) (#4134)
echoix Aug 10, 2024
71f8a81
g.region: Add JSON support (#3941)
kritibirda26 Aug 11, 2024
8fa7eb8
g.region: fix ruff lint error in tests (#4167)
kritibirda26 Aug 12, 2024
0fb6611
CI(deps): Update ruff to v0.5.7 (#4156)
renovate[bot] Aug 13, 2024
cb013cc
CI(deps): Update actions/upload-artifact action to v4.3.6 (#4143)
renovate[bot] Aug 13, 2024
d8dd589
grass.jupyter: add authorship and add missing docstrings (#4159)
29riyasaxena Aug 13, 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
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/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@eb055d739abdc2e8de2e5f4ba1a8b246daa779aa # v3.26.0
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@eb055d739abdc2e8de2e5f4ba1a8b246daa779aa # v3.26.0
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@16ebe778df0e7752d2cfcbd924afdbbd89c1a755 # v6.6.1
with:
push: true
pull: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
nc_spm_full_v2alpha2.tar.gz"
- 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-macOS
path: testreport
Expand Down
71 changes: 40 additions & 31 deletions .github/workflows/macos_dependencies.txt
Original file line number Diff line number Diff line change
@@ -1,39 +1,48 @@
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
libjpeg-turbo
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
python
python.app
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
12 changes: 6 additions & 6 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 @@ -129,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@eb055d739abdc2e8de2e5f4ba1a8b246daa779aa # v3.26.0
with:
sarif_file: bandit.sarif

Expand Down Expand Up @@ -201,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/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
6 changes: 3 additions & 3 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 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
3 changes: 3 additions & 0 deletions docker/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ ENV GRASS_SKIP_MAPSET_OWNER_CHECK=1 \
COPY --from=build /usr/local/bin/grass /usr/local/bin/grass
COPY --from=build /usr/local/grass* /usr/local/grass/
COPY --from=build /usr/lib/gdalplugins/*_GRASS.so /usr/lib/gdalplugins/
# Set GISBASE
ENV GISBASE /usr/local/grass

# run simple LAZ test
COPY docker/testdata/simple.laz /tmp/
COPY docker/testdata/test_grass_python.py docker/testdata/test_grass_session.py docker/alpine/grass_tests.sh /scripts/
Expand Down
9 changes: 7 additions & 2 deletions general/g.findfile/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ int main(int argc, char *argv[])
struct Option *mapset_opt;
struct Option *file_opt;
struct Flag *n_flag, *l_flag;
size_t len;

module = G_define_module();
G_add_keyword(_("general"));
Expand Down Expand Up @@ -104,8 +105,12 @@ int main(int argc, char *argv[])
strcpy(name, file_opt->answer);
G_free_tokens(map_mapset);
}
else
strcpy(name, file_opt->answer);
else {
len = G_strlcpy(name, file_opt->answer, sizeof(name));
if (len >= sizeof(name)) {
G_fatal_error(_("Name <%s> is too long"), file_opt->answer);
}
}

mapset = G_find_file2(elem_opt->answer, name, search_mapset);
if (mapset) {
Expand Down
2 changes: 1 addition & 1 deletion general/g.region/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ MODULE_TOPDIR = ../..

PGM = g.region

LIBES = $(GPROJLIB) $(VECTORLIB) $(DIG2LIB) $(RASTER3DLIB) $(RASTERLIB) $(GISLIB) $(MATHLIB) $(PROJLIB)
LIBES = $(GPROJLIB) $(VECTORLIB) $(DIG2LIB) $(RASTER3DLIB) $(RASTERLIB) $(GISLIB) $(MATHLIB) $(PROJLIB) $(PARSONLIB)
DEPENDENCIES = $(GPROJDEP) $(VECTORDEP) $(DIG2DEP) $(RASTER3DDEP) $(RASTERDEP) $(GISDEP)
EXTRA_INC = $(VECT_INC) $(PROJINC)
EXTRA_CFLAGS = $(VECT_CFLAGS)
Expand Down
53 changes: 53 additions & 0 deletions general/g.region/g.region.html
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,59 @@ <h3>Using g.region in a shell in combination with GDAL</h3>
Here the input raster map does not have to match the project's
coordinate reference system since it is reprojected on the fly.

<h3>JSON Output</h3>
<div class="code"><pre>
g.region -p format=json
</pre></div>
<div class="code"><pre>
{
"projection": "99 (Lambert Conformal Conic)",
"zone": 0,
"datum": "nad83",
"ellipsoid": "a=6378137 es=0.006694380022900787",
"region": {
"north": 320000,
"south": 10000,
"west": 120000,
"east": 935000,
"ns-res": 500,
"ns-res3": 1000,
"ew-res": 500,
"ew-res3": 1000
},
"top": 500,
"bottom": -500,
"tbres": 100,
"rows": 620,
"rows3": 310,
"cols": 1630,
"cols3": 815,
"depths": 10,
"cells": 1010600,
"cells3": 2526500
}
</pre></div>

<div class="code"><pre>
g.region -l format=json
</pre></div>
<div class="code"><pre>
{
"nw_long": -78.688888505507336,
"nw_lat": 35.743893244701788,
"ne_long": -78.669097826118957,
"ne_lat": 35.743841072010554,
"se_long": -78.669158624787542,
"se_lat": 35.728968779193615,
"sw_long": -78.688945667963168,
"sw_lat": 35.729020942542441,
"center_long": -78.679022655614958,
"center_lat": 35.736431420327719,
"rows": 165,
"cols": 179
}
</pre></div>

<h2>SEE ALSO</h2>

<em>
Expand Down
7 changes: 6 additions & 1 deletion general/g.region/local_proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@
#define PRINT_GMT 0x200
#define PRINT_WMS 0x400

#include <grass/parson.h>

enum OutputFormat { PLAIN, SHELL, JSON };

/* zoom.c */
int zoom(struct Cell_head *, const char *, const char *);

/* printwindow.c */
void print_window(struct Cell_head *, int, int);
void print_window(struct Cell_head *, int, int, enum OutputFormat,
JSON_Object *);

#endif
Loading
Loading