Skip to content

docs: Fix crash and simplify git calls in mkdocs generation#7604

Merged
echoix merged 2 commits into
OSGeo:mainfrom
petrasovaa:fix-md-compilation
Jun 27, 2026
Merged

docs: Fix crash and simplify git calls in mkdocs generation#7604
echoix merged 2 commits into
OSGeo:mainfrom
petrasovaa:fix-md-compilation

Conversation

@petrasovaa

Copy link
Copy Markdown
Contributor

This is trying to resolve regression after #7310 causing problems in addon compilation in CI. To be honest I am not sure I quite understand the exact mechanism, why gs is None in CI, but this PR should hopefully address the problems in logs like:

Traceback (most recent call last):
  File "/home/runner/install/grass86/utils/mkhtml.py", line 65, in <module>
    get_version_branch(
    ~~~~~~~~~~~~~~~~~~^
        major,
        ^^^^^^
        urlparse.urljoin(base_url, "grass-addons/"),
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ),
    ^
  File "/home/runner/install/grass86/utils/mkdocs.py", line 76, in get_version_branch
    branch = gs.Popen(
             ^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'Popen'

This PR replaces gs.Popen/decode calls with standard Python calls.
One change I am not sure about is in get_addon_path where if gs was not available, it replaced fatal with sys.stderr.write, which is not the same, it does not exit. That seemed like unintentional, so I replaced it with sys.exit, but I am not sure about that.

@petrasovaa
petrasovaa requested a review from wenzeslaus June 24, 2026 14:38
@github-actions github-actions Bot added the Python Related code is in Python label Jun 24, 2026
@petrasovaa

Copy link
Copy Markdown
Contributor Author

The CI addon compilation reports success for almost all addons.

@tmszi

tmszi commented Jun 25, 2026

Copy link
Copy Markdown
Member

My opinion is that better solution is switching from the Make to CMake (which setting -DPYTHON_EXECUTABLE) for compiling addons in the CI. CI use compile_addons_git.sh BASH script with Make command for addons compilation, but g.extension use CMake.

gs is None because Make command in CI compile_addons_git.sh doesn't initialize PYTHON_PATH ENV.

@echoix

echoix commented Jun 27, 2026

Copy link
Copy Markdown
Member

My opinion is that better solution is switching from the Make to CMake (which setting -DPYTHON_EXECUTABLE) for compiling addons in the CI. CI use compile_addons_git.sh BASH script with Make command for addons compilation, but g.extension use CMake.

gs is None because Make command in CI compile_addons_git.sh doesn't initialize PYTHON_PATH ENV.

It might be a good next step, let’s keep the idea

@echoix
echoix merged commit c967be5 into OSGeo:main Jun 27, 2026
27 checks passed
@github-actions github-actions Bot added this to the 8.6.0 milestone Jun 27, 2026
@petrasovaa
petrasovaa deleted the fix-md-compilation branch June 30, 2026 13:56
@neteler

neteler commented Jun 30, 2026

Copy link
Copy Markdown
Member

@petrasovaa to be backported to G8.5?

@petrasovaa

Copy link
Copy Markdown
Contributor Author

I am not sure whether 8.5 has the same problem. It's probably harmless to backport.

@neteler neteler added the backport to 8.5 PR needs to be backported to release branch 8.5 label Jul 1, 2026
neteler pushed a commit that referenced this pull request Jul 1, 2026
* docs: Fix crash and simplify git calls in mkdocs generation

* exit instead of just writing message
@neteler

neteler commented Jul 1, 2026

Copy link
Copy Markdown
Member

Backporting worked after cherrypicking 951be1f (#7310)

@neteler neteler removed the backport to 8.5 PR needs to be backported to release branch 8.5 label Jul 1, 2026
@neteler neteler modified the milestones: 8.6.0, 8.5.1 Jul 1, 2026
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Jul 7, 2026
* docs: Fix crash and simplify git calls in mkdocs generation

* exit instead of just writing message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Python Related code is in Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants