[GRASS-git] [OSGeo/grass] c62050: grass.app: Add project create subcommand (#6441)

Vaclav Petras noreply at github.com
Fri Oct 3 15:19:34 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/OSGeo/grass
  Commit: c620508745fd57bebc3c528126a4f95391fccfba
      https://github.com/OSGeo/grass/commit/c620508745fd57bebc3c528126a4f95391fccfba
  Author: Vaclav Petras <wenzeslaus at gmail.com>
  Date:   2025-10-03 (Fri, 03 Oct 2025)

  Changed paths:
    M python/grass/app/cli.py
    M python/grass/app/tests/grass_app_cli_test.py
    M python/grass/script/core.py

  Log Message:
  -----------
  grass.app: Add project create subcommand (#6441)

The create_project function is readily available for CLI use especially with the new crs parameter (added in #6415), so this is adding the functionality under as `project create` subcommand. All create_project parameters are exposed, so the user is not limited to what crs parameter can currently handle.

This will be useful in tests of the subcommand CLI itself if we want to use the other subcommands rather than the Python functions in the tests (of subcommands). It is used for lock and unlock tests in #6437.

A --project parameter is added to the run subcommand which now can use existing project instead of creating a new one. This makes subcommand `run --project project/path ...` roughly equivalent to `grass project/path --exec ...`. The functionality is used in the test to check the resulting project CRS.

Example subcomands:
project create --crs EPSG:3358 /tmp/project_1
run --project /tmp/project_1 g.mapset -p

Adds missing documentation for crs parameter of create_project. Also, this uses the description parameter from #6440 not desc.

Implementation of the subcommand now uses StackExit context manager to handle the only-sometimes-needed temporary directory.



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