[GRASS-git] [OSGeo/grass] 98c4cc: tests: Use copy of env for init (#6513)

Edouard Choinière noreply at github.com
Sat Oct 18 09:48:06 PDT 2025


  Branch: refs/heads/renovate/ubuntu-24.x
  Home:   https://github.com/OSGeo/grass
  Commit: 98c4ccf0c3dcb4266d63dd1a108a2ff44fdc880d
      https://github.com/OSGeo/grass/commit/98c4ccf0c3dcb4266d63dd1a108a2ff44fdc880d
  Author: Vaclav Petras <wenzeslaus at gmail.com>
  Date:   2025-10-16 (Thu, 16 Oct 2025)

  Changed paths:
    M python/grass/tools/tests/grass_tools_session_tools_pack_test.py
    M raster/r.out.gdal/tests/test_r_out_gdal.py
    M vector/v.colors/tests/test_v_colors.py
    M vector/v.decimate/tests/test_v_decimate.py

  Log Message:
  -----------
  tests: Use copy of env for init (#6513)

Some tests were not using a copy of the global environment and were modifying os.environ. This is a bad practice in the tests. While the fix is easy, preventing this from happening again is not possible with the current code since we want it to be easy to use the global environment.

The global environment is still used in tests of grass.jupyter, but there we need first to add an env parameter everywhere to enable the isolated testing, so that's not covered in this changeset.


  Commit: 4bf86facd82ef1490c2bf277c4400015de95a759
      https://github.com/OSGeo/grass/commit/4bf86facd82ef1490c2bf277c4400015de95a759
  Author: Markus Metz <33666869+metzm at users.noreply.github.com>
  Date:   2025-10-16 (Thu, 16 Oct 2025)

  Changed paths:
    M vector/v.out.ogr/export_areas_fast.c
    M vector/v.out.ogr/export_lines_fast.c

  Log Message:
  -----------
  v.out.ogr: fix fast export of areas (#6475)


  Commit: 2bd2d0ae1d9fb6d99f0d3609ab1fb342209a8799
      https://github.com/OSGeo/grass/commit/2bd2d0ae1d9fb6d99f0d3609ab1fb342209a8799
  Author: Vaclav Petras <wenzeslaus at gmail.com>
  Date:   2025-10-16 (Thu, 16 Oct 2025)

  Changed paths:
    M lib/gis/tests/lib_gis_env_test.py
    M python/grass/script/tests/conftest.py
    M python/grass/script/tests/grass_script_core_location_test.py
    M python/grass/script/tests/grass_script_setup_test.py

  Log Message:
  -----------
  tests: Use string and subprocess for isolation (#6514)

Instead of using multiprocessing, use code in a string and subprocess with sys.executable to run code in isolation. While this is requires the tested code to be in a string as opposed to a function, this avoids many issues of multiprocessing (stuck queue on failure, complexities of spawning). It replaces queue communication with JSON in stdout which requires additional care in what is actually printed.

As a result, the global environment is clearly not changed (it is a subprocess) as opposed to relying on multiprocessing behavior. For C library test, the separation of processes is even more clear, while at the same time, the test itself can now set up the runtime environment for dynamic libraries instead of relying on the external environment.

Renames and document tests in grass_script_setup_test.py with their current scope as their scope shifted when only one way of isolating and calling is used (no more partial vs nested function). Clarify role of setting the global capturing stderr in the tests and add more capture stderr smoke testing.

Be more consistent in mocking no global session with the fixture.

Uses capture outputs and exception to report stderr from the subprocess to ensure it is reported instead of relying on stderr being printed through pytest (stderr does not show up on Windows in CI with pytest for failures in lib_gis_env_test.py).

The constructed script needs to use raw strings for the path to accommodate backslashes (as a way of dealing with Windows paths).

The library test is skipped on Windows because the environment is not refreshed with the changes made in Python. Python updates it, but the getter function on Windows apparently keeps using a cached version, so the C functions access with ctypes don't see GISRC and fail with no session.


  Commit: ec42cfa9e21e4fb1b3282f7e58b57d654cb9e0d2
      https://github.com/OSGeo/grass/commit/ec42cfa9e21e4fb1b3282f7e58b57d654cb9e0d2
  Author: Māris Nartišs <maris.gis at gmail.com>
  Date:   2025-10-17 (Fri, 17 Oct 2025)

  Changed paths:
    M configure
    M configure.ac
    M include/grass/config.h.in

  Log Message:
  -----------
  build: move config.h.in customizations to configure.ac (#6509)

All customization now lives in configure.ac and config.h.in can be safely regenerated

Some obsolete code removed, LFS detection modernized

Contains files regenerated with autoconf 2.72


  Commit: 85b38da2a379ec4916d76f06aea9ea99cd0d3571
      https://github.com/OSGeo/grass/commit/85b38da2a379ec4916d76f06aea9ea99cd0d3571
  Author: Māris Nartišs <maris.gis at gmail.com>
  Date:   2025-10-17 (Fri, 17 Oct 2025)

  Changed paths:
    M configure
    M configure.ac
    M include/grass/config.h.in

  Log Message:
  -----------
  build: define more typical HAVE_PTHREAD if pthreads library can be used (#6479)


  Commit: 4541e23b3f4350c8a47a3098181f0fb2b055ef6c
      https://github.com/OSGeo/grass/commit/4541e23b3f4350c8a47a3098181f0fb2b055ef6c
  Author: Vaclav Petras <wenzeslaus at gmail.com>
  Date:   2025-10-17 (Fri, 17 Oct 2025)

  Changed paths:
    M lib/init/grass.py
    M python/grass/app/runtime.py
    A python/grass/app/tests/grass_app_resource_paths_test.py
    R python/grass/app/tests/grass_app_runtime.py
    A python/grass/app/tests/grass_app_runtime_test.py
    M python/grass/script/setup.py
    M python/grass/script/tests/grass_script_setup_test.py

  Log Message:
  -----------
  grass.app: Do env var setup in RuntimePaths (#6482)

In anticipation of #5630 which adds multiple variables besides GISBASE, this modifies RuntimePaths to handle variables from a list (dict to be exact). Now, only one variable is handled that way and that is GISBASE. The GRASS_PREFIX variable is handled in a different way because the compile-time values of the other variables are without a prefix and the RuntimePaths is prefixing them when the variable is needed.

The RuntimePaths object can now set environment variables when explicitly asked to do so. This hides the info about all the variables handled by the object inside the class code, so the caller does not need to know about a change from one GISBASE to multiple GISBASE-like variables. Both the main grass executable and the Python init function now use RuntimePaths to set up the GISBASE (and other GISBASE-like variables in the future).

While both usages of RuntimePaths are similar, they are not completely the same. Python init takes optional, caller-provided gisbase which is used as a prefix (assuming prefix and gisbase are, in practice, the same), while the main executable always uses the RuntimePaths default. Both test if the gisbase from RuntimePaths exists, and if not, they go to get_install_path to get a fallback one.

To allow for the fallback to take effect, RuntimePaths can take prefix in the constructor and will use it instead of the compile-time determined GRASS_PREFIX. Additionally, allow mixing of gisbase and prefix-only on the input which is needed for real installations, at least those without FHS. If the path is full GISBASE, the unique GISBASE part is removed, remove it to get the prefix only. The corresponding test passes with non-trivial GISBASE. Also, the consistency tests fail when the compile-time prefix path is non-sense.

For simple, and more readable code, avoid import alias for resource_paths and use the module name directly.

The actual init code needs to unfortunately deal with GISBASE directly. RuntimePaths itself always assumes that the paths are right, so any searches and fallbacks need to happen in the caller code. When we provide a corrected gisbase as a prefix, a broken build will supply wrong gisbase to the prefix breaking gisbase again, so we need to manually fix it with a subsequent call. This is not nice, and we need to have it at two different places now, but it is not a overly complicated code.

Generally, the tests are trying to check that resource paths are substituted during build and fail otherwise, i.e., the opposite of what the code is trying to do which is work even if the installation is broken in some way.


  Commit: f9854405c0c40241d63103ad4d947b321b7c38e4
      https://github.com/OSGeo/grass/commit/f9854405c0c40241d63103ad4d947b321b7c38e4
  Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  Date:   2025-10-18 (Sat, 18 Oct 2025)

  Changed paths:
    M .github/workflows/codeql-analysis.yml
    M .github/workflows/python-code-quality.yml

  Log Message:
  -----------
  CI(deps): Update github/codeql-action action to v4.30.9 (#6517)


  Commit: 747a1fac29f787177096db8c7aea8d3081e0e9ea
      https://github.com/OSGeo/grass/commit/747a1fac29f787177096db8c7aea8d3081e0e9ea
  Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  Date:   2025-10-18 (Sat, 18 Oct 2025)

  Changed paths:
    M .github/workflows/python-code-quality.yml
    M .pre-commit-config.yaml

  Log Message:
  -----------
  CI(deps): Update ruff to v0.14.1 (#6518)


  Commit: 6c91ea7cc5d087c356bc0b856b220e304d7732d2
      https://github.com/OSGeo/grass/commit/6c91ea7cc5d087c356bc0b856b220e304d7732d2
  Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  Date:   2025-10-18 (Sat, 18 Oct 2025)

  Changed paths:
    M .github/workflows/super-linter.yml

  Log Message:
  -----------
  CI(deps): Update super-linter/super-linter action to v8.2.1 (#6519)


  Commit: 02defa1db236e7595c93f66f942d278b036c246b
      https://github.com/OSGeo/grass/commit/02defa1db236e7595c93f66f942d278b036c246b
  Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  Date:   2025-10-18 (Sat, 18 Oct 2025)

  Changed paths:
    M .pre-commit-config.yaml

  Log Message:
  -----------
  CI(deps): Update pre-commit hook zizmorcore/zizmor-pre-commit to v1.15.2 (#6520)


  Commit: fc707d0e858093c3f3868c87d8b627f22d56a674
      https://github.com/OSGeo/grass/commit/fc707d0e858093c3f3868c87d8b627f22d56a674
  Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  Date:   2025-10-18 (Sat, 18 Oct 2025)

  Changed paths:
    M .github/workflows/python-code-quality.yml

  Log Message:
  -----------
  CI(deps): Update dependency pylint to v4.0.1 (#6516)


  Commit: d4a94288e9ebc15ee50b2d5bfc86fdeea6843171
      https://github.com/OSGeo/grass/commit/d4a94288e9ebc15ee50b2d5bfc86fdeea6843171
  Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  Date:   2025-10-18 (Sat, 18 Oct 2025)

  Changed paths:
    M man/mkdocs/requirements.txt

  Log Message:
  -----------
  CI(deps): Update dependency mkdocs-material to v9.6.22 (#6515)


  Commit: 4883264124d6e981958e380dae805bbf963f47d8
      https://github.com/OSGeo/grass/commit/4883264124d6e981958e380dae805bbf963f47d8
  Author: ShubhamDesai <42180509+ShubhamDesai at users.noreply.github.com>
  Date:   2025-10-18 (Sat, 18 Oct 2025)

  Changed paths:
    M raster/r.thin/io.c

  Log Message:
  -----------
  r.thin: Fix argument cannot be negative issue in io.c (#6507)


  Commit: 3eae6f60284654402288f2dd81a8772e87d9fd0a
      https://github.com/OSGeo/grass/commit/3eae6f60284654402288f2dd81a8772e87d9fd0a
  Author: OSGeo Weblate <97247866+osgeoweblate at users.noreply.github.com>
  Date:   2025-10-18 (Sat, 18 Oct 2025)

  Changed paths:
    M locale/po/grasslibs_ar.po
    M locale/po/grasslibs_bn.po
    M locale/po/grasslibs_cs.po
    M locale/po/grasslibs_de.po
    M locale/po/grasslibs_el.po
    M locale/po/grasslibs_es.po
    M locale/po/grasslibs_fi.po
    M locale/po/grasslibs_fr.po
    M locale/po/grasslibs_hu.po
    M locale/po/grasslibs_id_ID.po
    M locale/po/grasslibs_it.po
    M locale/po/grasslibs_ja.po
    M locale/po/grasslibs_ko.po
    M locale/po/grasslibs_lv.po
    M locale/po/grasslibs_ml.po
    M locale/po/grasslibs_pl.po
    M locale/po/grasslibs_pt.po
    M locale/po/grasslibs_pt_BR.po
    M locale/po/grasslibs_ro.po
    M locale/po/grasslibs_ru.po
    M locale/po/grasslibs_si.po
    M locale/po/grasslibs_sl.po
    M locale/po/grasslibs_sv.po
    M locale/po/grasslibs_ta.po
    M locale/po/grasslibs_th.po
    M locale/po/grasslibs_tr.po
    M locale/po/grasslibs_uk.po
    M locale/po/grasslibs_vi.po
    M locale/po/grasslibs_zh.po
    M locale/po/grassmods_ar.po
    M locale/po/grassmods_bn.po
    M locale/po/grassmods_cs.po
    M locale/po/grassmods_de.po
    M locale/po/grassmods_el.po
    M locale/po/grassmods_es.po
    M locale/po/grassmods_fi.po
    M locale/po/grassmods_fr.po
    M locale/po/grassmods_hu.po
    M locale/po/grassmods_id_ID.po
    M locale/po/grassmods_it.po
    M locale/po/grassmods_ja.po
    M locale/po/grassmods_ko.po
    M locale/po/grassmods_lv.po
    M locale/po/grassmods_ml.po
    M locale/po/grassmods_pl.po
    M locale/po/grassmods_pt.po
    M locale/po/grassmods_pt_BR.po
    M locale/po/grassmods_ro.po
    M locale/po/grassmods_ru.po
    M locale/po/grassmods_si.po
    M locale/po/grassmods_sl.po
    M locale/po/grassmods_sv.po
    M locale/po/grassmods_ta.po
    M locale/po/grassmods_th.po
    M locale/po/grassmods_tr.po
    M locale/po/grassmods_uk.po
    M locale/po/grassmods_vi.po
    M locale/po/grassmods_zh.po
    M locale/po/grasswxpy_ar.po
    M locale/po/grasswxpy_bn.po
    M locale/po/grasswxpy_cs.po
    M locale/po/grasswxpy_de.po
    M locale/po/grasswxpy_el.po
    M locale/po/grasswxpy_es.po
    M locale/po/grasswxpy_fi.po
    M locale/po/grasswxpy_fr.po
    M locale/po/grasswxpy_hu.po
    M locale/po/grasswxpy_id_ID.po
    M locale/po/grasswxpy_it.po
    M locale/po/grasswxpy_ja.po
    M locale/po/grasswxpy_ko.po
    M locale/po/grasswxpy_lv.po
    M locale/po/grasswxpy_ml.po
    M locale/po/grasswxpy_pl.po
    M locale/po/grasswxpy_pt.po
    M locale/po/grasswxpy_pt_BR.po
    M locale/po/grasswxpy_ro.po
    M locale/po/grasswxpy_ru.po
    M locale/po/grasswxpy_si.po
    M locale/po/grasswxpy_sl.po
    M locale/po/grasswxpy_sv.po
    M locale/po/grasswxpy_ta.po
    M locale/po/grasswxpy_th.po
    M locale/po/grasswxpy_tr.po
    M locale/po/grasswxpy_uk.po
    M locale/po/grasswxpy_vi.po
    M locale/po/grasswxpy_zh.po

  Log Message:
  -----------
  Translations update from OSGeo Weblate (#6521)


  Commit: 31fcb9dee814382d6d87d5318b1efb5c03dba403
      https://github.com/OSGeo/grass/commit/31fcb9dee814382d6d87d5318b1efb5c03dba403
  Author: Edouard Choinière <27212526+echoix at users.noreply.github.com>
  Date:   2025-10-18 (Sat, 18 Oct 2025)

  Changed paths:
    M .github/workflows/codeql-analysis.yml
    M .github/workflows/python-code-quality.yml
    M .github/workflows/super-linter.yml
    M .pre-commit-config.yaml
    M configure
    M configure.ac
    M include/grass/config.h.in
    M lib/gis/tests/lib_gis_env_test.py
    M lib/init/grass.py
    M locale/po/grasslibs_ar.po
    M locale/po/grasslibs_bn.po
    M locale/po/grasslibs_cs.po
    M locale/po/grasslibs_de.po
    M locale/po/grasslibs_el.po
    M locale/po/grasslibs_es.po
    M locale/po/grasslibs_fi.po
    M locale/po/grasslibs_fr.po
    M locale/po/grasslibs_hu.po
    M locale/po/grasslibs_id_ID.po
    M locale/po/grasslibs_it.po
    M locale/po/grasslibs_ja.po
    M locale/po/grasslibs_ko.po
    M locale/po/grasslibs_lv.po
    M locale/po/grasslibs_ml.po
    M locale/po/grasslibs_pl.po
    M locale/po/grasslibs_pt.po
    M locale/po/grasslibs_pt_BR.po
    M locale/po/grasslibs_ro.po
    M locale/po/grasslibs_ru.po
    M locale/po/grasslibs_si.po
    M locale/po/grasslibs_sl.po
    M locale/po/grasslibs_sv.po
    M locale/po/grasslibs_ta.po
    M locale/po/grasslibs_th.po
    M locale/po/grasslibs_tr.po
    M locale/po/grasslibs_uk.po
    M locale/po/grasslibs_vi.po
    M locale/po/grasslibs_zh.po
    M locale/po/grassmods_ar.po
    M locale/po/grassmods_bn.po
    M locale/po/grassmods_cs.po
    M locale/po/grassmods_de.po
    M locale/po/grassmods_el.po
    M locale/po/grassmods_es.po
    M locale/po/grassmods_fi.po
    M locale/po/grassmods_fr.po
    M locale/po/grassmods_hu.po
    M locale/po/grassmods_id_ID.po
    M locale/po/grassmods_it.po
    M locale/po/grassmods_ja.po
    M locale/po/grassmods_ko.po
    M locale/po/grassmods_lv.po
    M locale/po/grassmods_ml.po
    M locale/po/grassmods_pl.po
    M locale/po/grassmods_pt.po
    M locale/po/grassmods_pt_BR.po
    M locale/po/grassmods_ro.po
    M locale/po/grassmods_ru.po
    M locale/po/grassmods_si.po
    M locale/po/grassmods_sl.po
    M locale/po/grassmods_sv.po
    M locale/po/grassmods_ta.po
    M locale/po/grassmods_th.po
    M locale/po/grassmods_tr.po
    M locale/po/grassmods_uk.po
    M locale/po/grassmods_vi.po
    M locale/po/grassmods_zh.po
    M locale/po/grasswxpy_ar.po
    M locale/po/grasswxpy_bn.po
    M locale/po/grasswxpy_cs.po
    M locale/po/grasswxpy_de.po
    M locale/po/grasswxpy_el.po
    M locale/po/grasswxpy_es.po
    M locale/po/grasswxpy_fi.po
    M locale/po/grasswxpy_fr.po
    M locale/po/grasswxpy_hu.po
    M locale/po/grasswxpy_id_ID.po
    M locale/po/grasswxpy_it.po
    M locale/po/grasswxpy_ja.po
    M locale/po/grasswxpy_ko.po
    M locale/po/grasswxpy_lv.po
    M locale/po/grasswxpy_ml.po
    M locale/po/grasswxpy_pl.po
    M locale/po/grasswxpy_pt.po
    M locale/po/grasswxpy_pt_BR.po
    M locale/po/grasswxpy_ro.po
    M locale/po/grasswxpy_ru.po
    M locale/po/grasswxpy_si.po
    M locale/po/grasswxpy_sl.po
    M locale/po/grasswxpy_sv.po
    M locale/po/grasswxpy_ta.po
    M locale/po/grasswxpy_th.po
    M locale/po/grasswxpy_tr.po
    M locale/po/grasswxpy_uk.po
    M locale/po/grasswxpy_vi.po
    M locale/po/grasswxpy_zh.po
    M man/mkdocs/requirements.txt
    M python/grass/app/runtime.py
    A python/grass/app/tests/grass_app_resource_paths_test.py
    R python/grass/app/tests/grass_app_runtime.py
    A python/grass/app/tests/grass_app_runtime_test.py
    M python/grass/script/setup.py
    M python/grass/script/tests/conftest.py
    M python/grass/script/tests/grass_script_core_location_test.py
    M python/grass/script/tests/grass_script_setup_test.py
    M python/grass/tools/tests/grass_tools_session_tools_pack_test.py
    M raster/r.out.gdal/tests/test_r_out_gdal.py
    M raster/r.thin/io.c
    M vector/v.colors/tests/test_v_colors.py
    M vector/v.decimate/tests/test_v_decimate.py
    M vector/v.out.ogr/export_areas_fast.c
    M vector/v.out.ogr/export_lines_fast.c

  Log Message:
  -----------
  Merge branch 'main' into renovate/ubuntu-24.x


Compare: https://github.com/OSGeo/grass/compare/220d46887fe6...31fcb9dee814

To unsubscribe from these emails, change your notification settings at https://github.com/OSGeo/grass/settings/notifications


More information about the grass-commit mailing list