add exts_formatter param to allow formatting extension names in module files - #4125
add exts_formatter param to allow formatting extension names in module files#4125smoors wants to merge 5 commits into
exts_formatter param to allow formatting extension names in module files#4125Conversation
exts_formatter param to format extension names in module files
exts_formatter param to format extension names in module filesexts_formatter param to allow formatting extension names in module files
|
Test report by @smoors Overview of tested easyconfigs (in order)
Build succeeded for 1 out of 1 (total: 23 secs) (1 easyconfigs in total) |
|
example of what this does: @@ -12,20 +12,20 @@
Included extensions
===================
-flit_core-3.12.0
+flit-core-3.12.0
]==])
whatis([==[Description: This provides a PEP 517 build backend for packages using Flit.]==])
whatis([==[Homepage: https://pypi.org/project/flit]==])
whatis([==[URL: https://pypi.org/project/flit]==])
-whatis([==[Extensions: flit_core-3.12.0]==])
+whatis([==[Extensions: flit-core-3.12.0]==])
local root = "/scratch/brussel/vo/000/bvo00005/vsc10009/ebtest/testnormalize/software/flit-core/3.12.0-GCCcore-14.2.0"
conflict("flit-core")
if convertToCanonical(LmodVersion()) >= convertToCanonical("8.2.8") then
- extensions("flit_core/3.12.0")
+ extensions("flit-core/3.12.0")
end
@@ -40,5 +40,5 @@
prepend_path("EBPYTHONPREFIXES", root)
-- Built with EasyBuild version 5.3.1.dev0-r7691c52d99cfcc202f794e3d3c752b300f1a76e6
-setenv("EBEXTSLISTFLITMINCORE", "flit_core-3.12.0")
+setenv("EBEXTSLISTFLITMINCORE", "flit-core-3.12.0") |
| return REGEX_PIP_NORMALIZE.sub('-', name).lower() | ||
|
|
||
|
|
||
| def partial_normalize_pip(name): |
There was a problem hiding this comment.
@smoors Can we add a unit test for this function specifically?
Ideally it uses a couple of real-world cases, like flit_core, and also includes at least one case which features multiple subsequent underscores`, since currently:
>>> name = 'flit__core'
>>> REGEX_PIP_PARTIAL_NORMALIZE.sub('-', name).lower()
'flit-core'
(not sure if that's intentional?)
There was a problem hiding this comment.
(not sure if that's intentional?)
yes, that's intentional
see also https://packaging.python.org/en/latest/specifications/name-normalization/
There was a problem hiding this comment.
OK, good, then we can make that clear in the test for partial_normalize_pip.
There was a problem hiding this comment.
test added (and regex fixed)
param
exts_formatterallows to format extension names in module files for PythonPackage, PythonBundle, and Python easyblocks.by default, partially normalize the names: replace
_with-, but keep., as was agreed during a previous conf call: https://github.com/easybuilders/easybuild/wiki/Conference-call-notes-20260211will do nothing without companion framework PR (so can be safely merged)
exts_formatterfunction easybuild-framework#5186