Skip to content

added function find_glob_pattern to filetools.py#3297

Merged
boegel merged 4 commits intoeasybuilders:developfrom
ComputeCanada:find_glob_pattern
Apr 27, 2020
Merged

added function find_glob_pattern to filetools.py#3297
boegel merged 4 commits intoeasybuilders:developfrom
ComputeCanada:find_glob_pattern

Conversation

@mboisson
Copy link
Copy Markdown
Contributor

This function is used in the bender and the ROOT easyblocks. I also have a need for it in the qscintilla EasyBlock. I generalized it slightly to allow to not raise an exception if no match is found (but instead return None).

@kelseymh
Copy link
Copy Markdown
Contributor

I'm probably being too simple-minded here. I think the "self" argument to find_glob_pattern needs to be dropped (since filetools.py isn't a class), and the "self.dry_run" condition should be removed, or modified to be a passed-in argument from root.py and blender.py.

Copy link
Copy Markdown
Contributor

@Micket Micket left a comment

Choose a reason for hiding this comment

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

lgtm

@Micket
Copy link
Copy Markdown
Contributor

Micket commented Apr 23, 2020

sorry about that, my github was out-of-date, i totally missed the conversation

@Micket
Copy link
Copy Markdown
Contributor

Micket commented Apr 23, 2020

So, dry-run check at all seems a little bit strange to me; it's mostly used for functions that actually modify files and directories. This is just read only. I suppose it's just to avoid exceptions being thrown when expected directories aren't created due to a dry run?

@mboisson
Copy link
Copy Markdown
Contributor Author

The dryrun check is inherited from the code that was already in the two EasyBlocks. I did not want to remove it and risk breaking something.

@Micket
Copy link
Copy Markdown
Contributor

Micket commented Apr 23, 2020

Yeah I'm just not sure if the easyblock self.dry_run is really equivalent to if build_option('extended_dry_run'). Perhaps a input parameter is called for in that case.
As I don't really see the need for it in either case, I'd like input from a second maintainer.

@mboisson
Copy link
Copy Markdown
Contributor Author

Maybe @kelseymh can comment ?

@kelseymh
Copy link
Copy Markdown
Contributor

kelseymh commented Apr 23, 2020

@mboisson and @Micket The two are exactly the same:

self.dry_run = build_option('extended_dry_run')

Updated: the same build_option('extended_dry_run') construction is used in several of the other non-easyblock utilities, such as environment.py, elsewhere in filetools.py, github.py, and run.py.

@easybuilders easybuilders deleted a comment from boegelbot Apr 27, 2020
@boegel boegel added this to the next release (4.2.1?) milestone Apr 27, 2020
Copy link
Copy Markdown
Member

@boegel boegel left a comment

Choose a reason for hiding this comment

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

lgtm, thanks @mboisson!

@boegel boegel merged commit 8f02741 into easybuilders:develop Apr 27, 2020
@mboisson mboisson deleted the find_glob_pattern branch May 6, 2020 19:14
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.

4 participants