Skip to content

avoid that --inject-checksums introduces list of patches for extensions as a single long line (fixes #2734)#3025

Merged
akesandgren merged 2 commits intoeasybuilders:developfrom
boegel:fix_inject_checksums_ext_patches
Sep 26, 2019
Merged

avoid that --inject-checksums introduces list of patches for extensions as a single long line (fixes #2734)#3025
akesandgren merged 2 commits intoeasybuilders:developfrom
boegel:fix_inject_checksums_ext_patches

Conversation

@boegel
Copy link
Copy Markdown
Member

@boegel boegel commented Sep 21, 2019

problem reported in #2734 reproduced in tests, and then fixed

@boegel boegel added the bug fix label Sep 21, 2019
@boegel boegel added this to the next release (4.0.1) milestone Sep 21, 2019
@boegel boegel force-pushed the fix_inject_checksums_ext_patches branch 2 times, most recently from 9def0be to 4fdc285 Compare September 21, 2019 17:27
@easybuilders easybuilders deleted a comment from boegelbot Sep 21, 2019
@boegel boegel force-pushed the fix_inject_checksums_ext_patches branch from 4fdc285 to 05300af Compare September 22, 2019 14:50
@easybuilders easybuilders deleted a comment from boegelbot Sep 22, 2019
@boegel boegel requested a review from akesandgren September 22, 2019 14:53
val = quote_str(val, prefer_single_quotes=True)
exts_list_lines.append("%s'%s': %s," % (INDENT_4SPACES * 2, key, val))
strval = quote_str(val, prefer_single_quotes=True)
line = "%s'%s': %s," % (INDENT_4SPACES * 2, key, strval)
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.

When are we dropping python 2 support? This would look so much better with f-strings :-P

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's not that bad... It's not pretty, sure, but does it have to be?

We use %s string templating pretty consistently across the codebase, which is more important imho...

When we drop Python 2 support (perhaps with EasyBuild 5, time will tell), I'll count on you to port all of that to f-strings so we can keep things consistent. ;)

Would this be better?

line = INDENT_4SPACES * 2 + "'" + key + "': " + strval + ","

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.

That's much more readable IMO, but I am ok keeping the other approach. My comment was a general comment, nothing that have to be necessarily changed now.

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.

Nah, the "%s'%s': %s," is much easier to read. I'm a C-programmer by heart....

Comment thread easybuild/framework/easyblock.py Outdated
@damianam
Copy link
Copy Markdown
Member

@akesandgren you were also requested for review. I can merge it right now, but since @boegel is counting on you I rather wait ;-)

@boegel
Copy link
Copy Markdown
Member Author

boegel commented Sep 25, 2019

To be clear, I requested @akesandgren's review since the reported the bug being fixed here, not because we'd block the PR... ;)

Copy link
Copy Markdown
Contributor

@akesandgren akesandgren left a comment

Choose a reason for hiding this comment

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

LGTM

@akesandgren
Copy link
Copy Markdown
Contributor

Going in, thanks @boegel!

@akesandgren akesandgren merged commit cc0553a into easybuilders:develop Sep 26, 2019
@boegel boegel deleted the fix_inject_checksums_ext_patches branch September 26, 2019 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants