Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions easybuild/framework/easyconfig/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,11 @@
'SOURCE_%s' % suffix: ('%(name)s-%(version)s.' + ext, "Source .%s bundle" % ext),
'SOURCELOWER_%s' % suffix: ('%(namelower)s-%(version)s.' + ext, "Source .%s bundle with lowercase name" % ext),
})
TEMPLATE_CONSTANTS.update({
Comment on lines 273 to +274
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to make this 2 operations which might slow down EB startup even further.

Suggested change
})
TEMPLATE_CONSTANTS.update({

Played around with the prior code how to do this with a single update call and dict comprehension (fastest in CPython) but not sure if people find this easier to read ;-)

TEMPLATE_CONSTANTS.update({
    key: value
    for ext in EXTENSIONS
    for key, value in (
        (
            f"SOURCE_{ext.replace('.', '_').upper()}",
            (f"%(name)s-%(version)s.{ext}", f"Source .{ext} bundle"),
        ),
        (
            f"SOURCELOWER_{ext.replace('.', '_').upper()}",
            (f"%(namelower)s-%(version)s.{ext}", f"Source .{ext} bundle with lowercase name"),
        ),
    )
})

'VERSION_%s' % suffix: ('%(version)s.' + ext, "Source filename <version>.%s common at GitHub" % ext),
'VVERSION_%s' % suffix: ('v%(version)s.' + ext, "Source filename v<version>.%s common at GitHub" % ext),
})

for pyver in ('py2.py3', 'py2', 'py3'):
if pyver == 'py2.py3':
desc = 'Python 2 & Python 3'
Expand Down