Skip to content

Conversation

@j3mdamas
Copy link

@j3mdamas j3mdamas commented Nov 20, 2025

Closes #3965

I used git config as a reference: https://git-scm.com/docs/git-config#SCOPES

(there they call the easybuild user scope global scope, but we don't need to change that)

I ran some small tests locally with eb --show-default-configfiles and eb --show-config and everything seems to work as expected, but I don't know if there are some unit tests I should create.

tagging: @boegel

Copy link
Member

@boegel boegel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@j3mdamas Ideally we have an extra (dedicated) unit test for this, test/framework/config.py is the right place for that I think.

Do let us know if that's a bridge too far for you!

'',
"[with $XDG_CONFIG_HOME: %s, $XDG_CONFIG_DIRS: %s]" % (xdg_config_home, xdg_config_dirs),
'',
"* local-level: %s" % os.path.join('.', 'config.cfg'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change this to avoid confusion:

Suggested change
"* local-level: %s" % os.path.join('.', 'config.cfg'),
"* current working directory: %s" % os.path.join('.', 'config.cfg'),

DEFAULT_SYS_CFGFILES = [sorted(glob.glob(os.path.join(d, 'easybuild.d', '*.cfg')))
for d in XDG_CONFIG_DIRS]
DEFAULT_USER_CFGFILE = os.path.join(XDG_CONFIG_HOME, 'easybuild', 'config.cfg')
DEFAULT_LOCAL_CFGFILE = os.path.join(os.path.normpath(os.getcwd()), 'config.cfg')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe rename to DEFAULT_CWD_CFGFILE, or DEFAULT_CURRENT_WORKING_DIR_CFGFILE if that's not clear enough?
I think "local" could be interpreted differently

@boegel boegel added this to the 5.x milestone Dec 3, 2025
@boegel boegel changed the title Adds local scope to config files pick up on config.cfg EasyBuild configuration file in current working directory Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Working directory pickup of configuration files

2 participants