Skip to content

Add extension_name property to EasyBlock & do NOT inherit parent extension_name - #5313

Merged
boegel merged 2 commits into
easybuilders:developfrom
Flamefire:extension_name-property
Oct 7, 2026
Merged

boegel merged 2 commits into
easybuilders:developfrom
Flamefire:extension_name-property

Conversation

@Flamefire

@Flamefire Flamefire commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

As it is expected that the fallback of extension_name to name is often useful it makes sense to have a unique place for that.

The test discovered a critical flaw: We need to reset extension_name in Extension.__init__

@boegel Can you add this to the next release before we ship the extension_name feature?
Can also extract the bugfix although the test is easier with the property

Related: Shall we support templates in extension_name of extensions?
We currently support templates in the name (why? I don't see a use case) and I kept the existing mechanism in #5259 such that:
('foo', 1, {extension_name: "%(name)s-%(version)s"}) would resolve extension_name to foo-1 but I'm not sure that makes sense and it would complicate things for us if we want to use extension_name to derive template values as we would need to resolve extension templates once, then resolve extension_name, then resolve again, i.e. what we do in

# construct dictionary with template values;
# inherited from parent, except for name/version templates which are specific to this extension
template_values = copy.deepcopy(self.cfg.template_values)
template_values.update(template_constant_dict(ext_src))
# Resolve this here where we have the template values available
if 'extension_name' in ext_options:
ext_options['extension_name'] = resolve_template(ext_options['extension_name'], template_values)

As it is expected that the fallback of `extension_name` to `name` is
often useful it makes sense to have a unique place for that.

@boegel boegel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@boegel
boegel merged commit e34333f into easybuilders:develop Oct 7, 2026
41 checks passed
@Flamefire
Flamefire deleted the extension_name-property branch October 7, 2026 07:27
@Flamefire

Copy link
Copy Markdown
Contributor Author

@boegel Have you considered this question? Would need deciding before shipping.

Related: Shall we support templates in extension_name of extensions?

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.

2 participants