Skip to content

Commit

Permalink
Merge branch 'OSGeo:main' into r.buffer-test
Browse files Browse the repository at this point in the history
  • Loading branch information
Shreshth-Malik authored Oct 22, 2024
2 parents 78e090a + af55fa7 commit f782be7
Show file tree
Hide file tree
Showing 273 changed files with 1,963 additions and 1,603 deletions.
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ omit =
${INITIAL_PWD-.}/.github/*
${INITIAL_PWD-.}/bin.*/*
${INITIAL_PWD-.}/dist.*/*
**/gui/wxpython/*/**
**/OBJ.*/*
source =
.
Expand Down
24 changes: 5 additions & 19 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,14 @@ per-file-ignores =
# E741 ambiguous variable name 'l'
__init__.py: F401, F403
man/build_html.py: E501
imagery/i.atcorr/create_iwave.py: F632, F821, W293
doc/python/m.distance.py: E501
doc/gui/wxpython/example/dialogs.py: F401
gui/scripts/d.wms.py: E501
gui/wxpython/image2target/*: F841, E722
gui/wxpython/image2target/g.gui.image2target.py: E501, F841
gui/wxpython/lmgr/frame.py: E722
# layertree still includes some formatting issues (it is ignored by Black)
gui/wxpython/lmgr/layertree.py: E722
gui/wxpython/modules/*: F841, E722
gui/wxpython/nviz/*: F841, E266, E722, F403, F405
gui/wxpython/image2target/g.gui.image2target.py: E501
gui/wxpython/nviz/*: E722
gui/wxpython/photo2image/*: F841, E722, E265
gui/wxpython/photo2image/g.gui.photo2image.py: E501, F841
gui/wxpython/psmap/*: F841, E266, E722, F405, F403
gui/wxpython/psmap/*: F841, E266, E722
gui/wxpython/vdigit/*: F841, E722, F405, F403
gui/wxpython/vnet/*: F841
gui/wxpython/wxgui.py: F841
gui/wxpython/animation/g.gui.animation.py: E501
gui/wxpython/tplot/frame.py: F841, E722
gui/wxpython/tplot/g.gui.tplot.py: E501
Expand Down Expand Up @@ -74,7 +65,6 @@ per-file-ignores =
# TODO: Is this really needed?
python/grass/pygrass/vector/__init__.py: E402
python/grass/pygrass/raster/__init__.py: E402
python/grass/gunittest/invoker.py: E721
python/grass/pygrass/vector/__init__.py: E402
python/grass/pygrass/modules/interface/*.py: F401
python/grass/pygrass/modules/grid/*.py: F401
Expand All @@ -90,13 +80,11 @@ per-file-ignores =
python/grass/temporal/temporal_granularity.py: E722
python/grass/temporal/temporal_raster_base_algebra.py: E722
python/grass/temporal/temporal_topology_dataset_connector.py: E722
python/grass/temporal/univar_statistics.py: E231
# Current benchmarks/tests are changing sys.path before import.
# Possibly, a different approach should be taken there anyway.
python/grass/pygrass/tests/benchmark.py: E402, F401, F821
# Configuration file for Sphinx:
# Ignoring import/code mix and line length.
python/grass/docs/conf.py: E402
# Files not managed by Black
python/grass/imaging/images2gif.py: E226
# Unused imports in init files
Expand All @@ -120,14 +108,12 @@ per-file-ignores =
scripts/i.pansharpen/i.pansharpen.py: E722, E501
scripts/r.in.srtm/r.in.srtm.py: E722
scripts/r.fillnulls/r.fillnulls.py: E722
scripts/d.rast.edit/d.rast.edit.py: E722
scripts/v.what.strds/v.what.strds.py: E722, E501
scripts/v.what.strds/v.what.strds.py: E501
# Line too long (esp. module interface definitions)
scripts/*/*.py: E501
temporal/t.rast.to.vect/t.rast.to.vect.py: E501
temporal/t.vect.algebra/t.vect.algebra.py: E501
# ## used (##% key: r etc)
temporal/t.rast.what/t.rast.what.py: E265, E266, E501
temporal/t.rast.what/t.rast.what.py: E501
# Line too long (esp. module interface definitions)
temporal/*/*.py: E501

Expand Down
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@84480863f228bb9747b473957fcc9e309aa96097 # v4.4.2
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
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@84480863f228bb9747b473957fcc9e309aa96097 # v4.4.2
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
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@c36620d31ac7c881962c3d9dd939c40ec9434f2b # v3.26.12
uses: github/codeql-action/init@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13
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@c36620d31ac7c881962c3d9dd939c40ec9434f2b # v3.26.12
uses: github/codeql-action/analyze@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13
with:
category: "/language:${{matrix.language}}"
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
nc_spm_full_v2alpha2.tar.gz"
- name: Make HTML test report available
if: ${{ !cancelled() }}
uses: actions/upload-artifact@84480863f228bb9747b473957fcc9e309aa96097 # v4.4.2
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: testreport-macOS
path: testreport
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/milestones.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
name: Assign Milestone

on:
pull_request_target:
types: [closed]

jobs:
assign-milestone:
runs-on: ubuntu-latest
if: github.event.pull_request.merged
steps:
# Retreiving the current milestoone from API instead of github context,
# so up-to-date information is used when running after being queued or for reruns
# Otherwise, the information should be available using
# ${{ github.event.pull_request.milestone.title }}
- name: Get current milestone title
id: current-milestone
run: |
echo "milestone<<EOF" >> "${GITHUB_OUTPUT}"
gh pr view ${{ github.event.pull_request.html_url }} --json milestone \
--jq .milestone.title >> "${GITHUB_OUTPUT}"
echo 'EOF' >> "${GITHUB_OUTPUT}"
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
- name: PR already has a milestone
run: echo "PR already has a milestone"
if: ${{ steps.current-milestone.outputs.milestone }}
- name: PR does not have a milestone
run: echo "PR does not have a milestone"
if: ${{ !steps.current-milestone.outputs.milestone }}
- name: Get VERSION file
if: ${{ !steps.current-milestone.outputs.milestone }}
id: version-file
run: |
echo "version<<EOF" >> "${GITHUB_OUTPUT}"
gh api \
-H "Accept: application/vnd.github.raw" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"/repos/{owner}/{repo}/contents/include/VERSION?ref=${{ github.sha }}" >> "${GITHUB_OUTPUT}"
echo "EOF" >> "${GITHUB_OUTPUT}"
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
- name: Show version file
if: ${{ !steps.current-milestone.outputs.milestone }}
run: echo "${VERSIONFILE}"
env:
VERSIONFILE: ${{ steps.version-file.outputs.version }}
- name: Get milestone title from VERSION file
if: ${{ !steps.current-milestone.outputs.milestone }}
id: milestone
run: |
version=$(echo "$VERSIONFILE" | head -n 3 | xargs | sed 's/ /./g; s/\(RC[0-9]*\|dev\)//g')
echo "title=$version" >> "${GITHUB_OUTPUT}"
env:
VERSIONFILE: ${{ steps.version-file.outputs.version }}
- name: Show milestone title
if: ${{ !steps.current-milestone.outputs.milestone }}
run: echo "${MILESTONE}"
env:
MILESTONE: ${{ steps.milestone.outputs.title }}
- name: Set PR milestone
if: ${{ !steps.current-milestone.outputs.milestone }}
run: gh pr edit ${{ github.event.pull_request.html_url }} --milestone "${MILESTONE}"
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
MILESTONE: ${{ steps.milestone.outputs.title }}
2 changes: 1 addition & 1 deletion .github/workflows/osgeo4w.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ jobs:

- name: Make HTML test report available
if: ${{ always() }}
uses: actions/upload-artifact@84480863f228bb9747b473957fcc9e309aa96097 # v4.4.2
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: testreport-${{ matrix.os }}
path: testreport
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,25 @@ jobs:
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}"
pytest --verbose --color=yes --durations=0 --durations-min=0.5 \
--numprocesses auto -ra . \
--numprocesses auto \
--cov \
--cov-context=test \
-ra . \
-m 'not needs_solo_run'
- name: Run pytest with a single worker (for tests marked with needs_solo_run)
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)"
INITIAL_PWD="${PWD}" pytest --verbose --color=yes --durations=0 --durations-min=0.5 \
export INITIAL_PWD="${PWD}"
pytest --verbose --color=yes --durations=0 --durations-min=0.5 \
--cov \
--cov-context=test \
--cov-append \
-ra . \
-m 'needs_solo_run'
- name: Fix non-standard installed script paths in coverage data
Expand All @@ -116,7 +123,7 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Make python-only code coverage test report available
if: ${{ !cancelled() }}
uses: actions/upload-artifact@84480863f228bb9747b473957fcc9e309aa96097 # v4.4.2
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: python-codecoverage-report-${{ matrix.os }}-${{ matrix.python-version }}
path: coverage_html_report
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/python-code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
# renovate: datasource=pypi depName=bandit
BANDIT_VERSION: "1.7.10"
# renovate: datasource=pypi depName=ruff
RUFF_VERSION: "0.6.9"
RUFF_VERSION: "0.7.0"

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@84480863f228bb9747b473957fcc9e309aa96097 # v4.4.2
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: bandit.sarif
path: bandit.sarif

- name: Upload SARIF File into Security Tab
uses: github/codeql-action/upload-sarif@c36620d31ac7c881962c3d9dd939c40ec9434f2b # v3.26.12
uses: github/codeql-action/upload-sarif@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13
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@84480863f228bb9747b473957fcc9e309aa96097 # v4.4.2
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
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 @@ -149,7 +149,7 @@ jobs:

- name: Make HTML test report available
if: ${{ always() }}
uses: actions/upload-artifact@84480863f228bb9747b473957fcc9e309aa96097 # v4.4.2
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: testreport-${{ matrix.os }}-${{ matrix.config }}-${{ matrix.extra-include }}
path: testreport
Expand Down
2 changes: 1 addition & 1 deletion .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.6.9
rev: v0.7.0
hooks:
# Run the linter.
- id: ruff
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

ARG GUI=without

FROM ubuntu:22.04@sha256:58b87898e82351c6cf9cf5b9f3c20257bb9e2dcf33af051e12ce532d7f94e3fe as common_start
FROM ubuntu:22.04@sha256:0e5e4a57c2499249aafc3b40fcd541e9a456aab7296681a3994d631587203f97 as common_start

LABEL authors="Carmen Tawalika,Markus Neteler,Anika Weinmann,Stefan Blumentrath"
LABEL maintainer="tawalika@mundialis.de,neteler@mundialis.de,weinmann@mundialis.de"
Expand Down
2 changes: 1 addition & 1 deletion display/d.histogram/d.histogram.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ <h2>DESCRIPTION</h2>
<h2>NOTES</h2>

<em>d.histogram</em> respects the current geographic region settings
and the current MASK (if one exists).
and the current raster mask (if mask is active).

<p><em>d.histogram</em> uses the colors in the map's color look-up table
(i.e., the map's <em>colr</em> or <em>colr2</em> file).
Expand Down
7 changes: 5 additions & 2 deletions display/d.vect/attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ int display_attr(struct Map_info *Map, int type, char *attrcol,
db_init_string(&text);

fi = Vect_get_field(Map, lattr->field);
if (fi == NULL)
if (fi == NULL) {
Vect_destroy_line_struct(Points);
Vect_destroy_cats_struct(Cats);
return 1;

}
driver = db_start_driver_open_database(fi->driver, fi->database);
if (driver == NULL)
G_fatal_error(_("Unable to open database <%s> by driver <%s>"),
Expand Down Expand Up @@ -140,6 +142,7 @@ int display_attr(struct Map_info *Map, int type, char *attrcol,
db_close_database_shutdown_driver(driver);
Vect_destroy_line_struct(Points);
Vect_destroy_cats_struct(Cats);
Vect_destroy_field_info(fi);

return 0;
}
2 changes: 1 addition & 1 deletion doc/gui/wxpython/example/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# So we need to import it before any of the GUI code.
# NOTE: in this particular case, we don't really need the grass library;
# NOTE: we import it just for the side effects of gettext.install()
import grass
import grass # noqa: F401

from core import globalvar
from gui_core.dialogs import SimpleDialog
Expand Down
5 changes: 1 addition & 4 deletions doc/python/raster_example_ctypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@
sys.exit("You must be in GRASS GIS to run this program")

# parse command line arguments, prompt user for a raster map name if one wasn't given
if len(sys.argv) == 2:
input = sys.argv[1]
else:
input = input("Name of raster map? ")
input = sys.argv[1] if len(sys.argv) == 2 else input("Name of raster map? ")

# initialize GRASS library
G_gisinit("")
Expand Down
5 changes: 1 addition & 4 deletions doc/python/vector_example_ctypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@
if "GISBASE" not in os.environ:
sys.exit("You must be in GRASS GIS to run this program.")

if len(sys.argv) == 2:
input = sys.argv[1]
else:
input = input("Name of vector map? ")
input = sys.argv[1] if len(sys.argv) == 2 else input("Name of vector map? ")

# initialize GRASS library
G_gisinit("")
Expand Down
2 changes: 1 addition & 1 deletion docker/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

ARG GUI=without

FROM ubuntu:22.04@sha256:58b87898e82351c6cf9cf5b9f3c20257bb9e2dcf33af051e12ce532d7f94e3fe as common_start
FROM ubuntu:22.04@sha256:0e5e4a57c2499249aafc3b40fcd541e9a456aab7296681a3994d631587203f97 as common_start

LABEL authors="Carmen Tawalika,Markus Neteler,Anika Weinmann,Stefan Blumentrath"
LABEL maintainer="tawalika@mundialis.de,neteler@mundialis.de,weinmann@mundialis.de"
Expand Down
2 changes: 1 addition & 1 deletion docker/ubuntu_wxgui/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:22.04@sha256:58b87898e82351c6cf9cf5b9f3c20257bb9e2dcf33af051e12ce532d7f94e3fe
FROM ubuntu:22.04@sha256:0e5e4a57c2499249aafc3b40fcd541e9a456aab7296681a3994d631587203f97

LABEL authors="Carmen Tawalika,Markus Neteler,Anika Weinmann,Tomas Zigo"
LABEL maintainer="tawalika@mundialis.de,neteler@mundialis.de,weinmann@mundialis.de"
Expand Down
Loading

0 comments on commit f782be7

Please sign in to comment.