easybuild-framework icon indicating copy to clipboard operation
easybuild-framework copied to clipboard

Add `--debug-module-cmds` option

Open Flamefire opened this issue 1 month ago • 2 comments

This is disabled by default and hides the output of the module command. That is usually just "noise" hiding the relevant part of the log.

With it disabled the output looks like:

== 2025-11-14 10:58:31,197 run.py:511 INFO Running shell command '/opt/lmod/lmod/libexec/lmod python load GCC/4.6.3' in /git/easybuild-framework == 2025-11-14 10:58:31,261 run.py:625 INFO Shell command completed successfully: /opt/lmod/lmod/libexec/lmod python load GCC/4.6.3

I added small refactorings and fixes I've seen:

  • The type hint allows auto-completing in IDEs which is quite helpful for writing the test
  • re.sub('module use [...]', modtxt, re.M) was wrong: The 3rd parameter is count not flags
  • for key in dict: delete dict[key] is an error, see https://docs.python.org/3/library/stdtypes.html#dict-views
  • if any([generator expr]) creates the list before iterating it instead of only creating what is required, see https://github.com/easybuilders/easybuild-framework/pull/5043

Flamefire avatar Nov 14 '25 12:11 Flamefire

@Flamefire merge conflict to resolve...

boegel avatar Dec 07 '25 17:12 boegel

Looks like I identified and fixed the same bug in the tests in multiple occasions.

Rebased

Flamefire avatar Dec 08 '25 10:12 Flamefire