Skip to content

Add extension_name easyconfig parameter, to specify name of extension to use in generated module file - #5259

Merged
smoors merged 3 commits into
easybuilders:developfrom
Flamefire:extension-name
Sep 9, 2026
Merged

smoors merged 3 commits into
easybuilders:developfrom
Flamefire:extension-name

Conversation

@Flamefire

@Flamefire Flamefire commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

When set for an extension it is used instead of its name in the extension list of the module.
When set for a (root) easyconfig it will add an extension entry for it.

This can then be used by easyblocks e.g. to check for Python package name in pip list.

I would also combine it with #5257 : When extension_name is set it is used as the default for load_name. I expect that this applies to many packages. E.g. PyTorch is listed and loaded as torch

I also found and fixed a bug/inconsistency: For string-extensions templates were only resolved in make_extension_list but not in collect_exts_file_info

As for templating: extension_name templates are resolved using the extension templates, i.e. %(name)s is that of the extension, not the parent EC. That is consistent with the other options.

Initial draft done by AI, manually verified and adjusted afterwards

When set for an extension it is used instead of its name in the
extension list of the module.
When set for a (root) easyconfig it will add an extension entry for it.
This currently only happens when the module is created, but not when the
actual extension is created.
@boegel boegel changed the title Add extension_name parameter Add extension_name easyconfig parameter, to specify name of extension to use in generated module file Sep 9, 2026
@smoors

smoors commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

tested by adding extension_name = 'cover-age' to coverage-7.10.7-GCCcore-14.2.0.eb, seems to work fine.

resulting coverage/7.10.7-GCCcore-14.2.0.lua file:

help([==[                                         

Description                
===========
Coverage.py is a tool for measuring code coverage of Python programs.
 It monitors your program, noting which parts of the code have been executed,
 then analyzes the source to identify code that could have been executed but was not.
                                                                   
                                                                                                                                      
More information                                                                                                                      
================                                                                                                                      
 - Homepage: https://coverage.readthedocs.io
                                                                   
                                                                   
Included extensions   
===================                               
cover-age-7.10.7
]==])  
                                                                   
whatis([==[Description:  Coverage.py is a tool for measuring code coverage of Python programs.
 It monitors your program, noting which parts of the code have been executed,
 then analyzes the source to identify code that could have been executed but was not. ]==])
whatis([==[Homepage: https://coverage.readthedocs.io]==])
whatis([==[URL: https://coverage.readthedocs.io]==])                                                                                  
whatis([==[Extensions: cover-age-7.10.7]==])
                                                                                                                                                                                                                                                                             
local root = "/sofia/scratch/pilot/badmin/vsc10009/ebtest/testpr5259/software/coverage/7.10.7-GCCcore-14.2.0"
                                                                                                                                                                                                                                                                             
conflict("coverage")
                                                                   
if convertToCanonical(LmodVersion()) >= convertToCanonical("8.2.8") then
    extensions("cover-age/7.10.7")                                                                                                                                                                                                                                           
end                                                                                                                                   
                                                                                                                                      
                                                                   
depends_on("GCCcore/14.2.0")
                                                                   
depends_on("Python/3.13.1-GCCcore-14.2.0")                                                                                                                                                                                                                                   
                                                                   
prepend_path("CMAKE_PREFIX_PATH", root)
prepend_path("PATH", pathJoin(root, "bin"))
setenv("EBROOTCOVERAGE", root)
setenv("EBVERSIONCOVERAGE", "7.10.7")
setenv("EBDEVELCOVERAGE", pathJoin(root, "easybuild", "coverage-7.10.7-GCCcore-14.2.0-easybuild-devel"))

prepend_path("EBPYTHONPREFIXES", root)
-- Built with EasyBuild version 5.4.1.dev0
setenv("EBEXTSLISTCOVERAGE", "cover-age-7.10.7")

@smoors smoors added this to the next release (5.4.1) milestone Sep 9, 2026

@smoors smoors left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@smoors
smoors merged commit ce087b5 into easybuilders:develop Sep 9, 2026
41 checks passed
@smoors

smoors commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

i was too soon, the above test should actually fail the sanity_check_pip_list check

@Flamefire

Copy link
Copy Markdown
Contributor Author

i was too soon, the above test should actually fail the sanity_check_pip_list check

No, that part is not implemented yet, that can only be done now.

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