[GRASS-git] [OSGeo/grass] 047e00: grass.script: Create new location without a sessio...

Vaclav Petras noreply at github.com
Sat Feb 17 10:10:31 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/OSGeo/grass
  Commit: 047e004c67c3c1638171605b2a75e23f17ead385
      https://github.com/OSGeo/grass/commit/047e004c67c3c1638171605b2a75e23f17ead385
  Author: Vaclav Petras <wenzeslaus at gmail.com>
  Date:   2024-02-17 (Sat, 17 Feb 2024)

  Changed paths:
    M python/grass/script/core.py
    M python/grass/script/setup.py
    M python/grass/script/tests/grass_script_core_location_test.py

  Log Message:
  -----------
  grass.script: Create new location without a session (#3432)

The function create_location now works without a full session. Internally, it sets up a runtime environment to execute tools (modules) without the connection to a location (project) which is sufficient for executing g.proj to create a location (project).

The new test covers the new functionality, but to actually test it, the test needs to run by itself because grass.script.setup.init (still) creates a global session.

env is always modified to avoid confusion when it is modified and when it is not (as opposed to the original idea of accommodating usage with os.environ by modifying that). Copy is up to the user which makes it clear when that actually happens which is longer but more readable.



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