Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

man: fix KeyError: 'MDDIR' in man/build_md.py #4739

Merged
merged 2 commits into from
Nov 23, 2024

Conversation

neteler
Copy link
Member

@neteler neteler commented Nov 22, 2024

At time the GRASS GIS main compilation with addons with cron_grass_preview_build_binaries.sh is broken:

https://grass.osgeo.org/grass85/binary/linux/snapshot/build.log.txt

...
Parsing <v.what.strds.timestamp>... SUCCESS
Parsing <wx.metadata>... FAILED
Parsing <wx.mwprecip>... FAILED
Parsing <wx.stream>... FAILED
Parsing <wx.wms>... FAILED
+ cp /home/neteler/.grass8/addons/modules.xml /var/www/code_and_data/addons/grass8/modules.xml
+ export ARCH
+ export ARCH_DISTDIR=/home/neteler/src//main/dist.x86_64-pc-linux-gnu
+ export GISBASE=/home/neteler/src//main/dist.x86_64-pc-linux-gnu
+ export VERSION_NUMBER=8.5
+ python3 /home/neteler/src//main/man/build_keywords.py /var/www/code_and_data/grass85/manuals/ /var/www/code_and_data/grass85/manuals/addons/
Traceback (most recent call last):
  File "/home/neteler/src//main/man/build_keywords.py", line 202, in <module>
    build_keywords("md")
  File "/home/neteler/src//main/man/build_keywords.py", line 68, in build_keywords
    from build_md import (
  File "/home/neteler/src/main/man/build_md.py", line 264, in <module>
    man_dir = os.path.join(os.environ["MDDIR"], "source")
  File "/usr/lib/python3.9/os.py", line 679, in __getitem__
    raise KeyError(key) from None
KeyError: 'MDDIR'

This PR attemps to fix this bug (inspired by man/build_html.py). Tested on grass.osgeo.org (without log file).

Originally reported in OSGeo/grass-addons#1241 (comment)

At time the GRASS GIS main compilation with addons with `cron_grass_preview_build_binaries.sh` is broken:

https://grass.osgeo.org/grass85/binary/linux/snapshot/build.log.txt

```
...
Parsing <v.what.strds.timestamp>... SUCCESS
Parsing <wx.metadata>... FAILED
Parsing <wx.mwprecip>... FAILED
Parsing <wx.stream>... FAILED
Parsing <wx.wms>... FAILED
+ cp /home/neteler/.grass8/addons/modules.xml /var/www/code_and_data/addons/grass8/modules.xml
+ export ARCH
+ export ARCH_DISTDIR=/home/neteler/src//main/dist.x86_64-pc-linux-gnu
+ export GISBASE=/home/neteler/src//main/dist.x86_64-pc-linux-gnu
+ export VERSION_NUMBER=8.5
+ python3 /home/neteler/src//main/man/build_keywords.py /var/www/code_and_data/grass85/manuals/ /var/www/code_and_data/grass85/manuals/addons/
Traceback (most recent call last):
  File "/home/neteler/src//main/man/build_keywords.py", line 202, in <module>
    build_keywords("md")
  File "/home/neteler/src//main/man/build_keywords.py", line 68, in build_keywords
    from build_md import (
  File "/home/neteler/src/main/man/build_md.py", line 264, in <module>
    man_dir = os.path.join(os.environ["MDDIR"], "source")
  File "/usr/lib/python3.9/os.py", line 679, in __getitem__
    raise KeyError(key) from None
KeyError: 'MDDIR'
```

This PR attemps to fix this bug (inspired by `man/build_html.py`). Tested on grass.osgeo.org (without log file).
@neteler neteler added manual Documentation related issues docs labels Nov 22, 2024
@neteler neteler added this to the 8.5.0 milestone Nov 22, 2024
@neteler neteler self-assigned this Nov 22, 2024
@github-actions github-actions bot added the Python Related code is in Python label Nov 22, 2024
@echoix echoix enabled auto-merge (squash) November 23, 2024 00:33
@echoix echoix merged commit a58e178 into OSGeo:main Nov 23, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs manual Documentation related issues Python Related code is in Python
Projects
Development

Successfully merging this pull request may close these issues.

3 participants