filter out duplicate paths added to module files#3770
filter out duplicate paths added to module files#3770akesandgren merged 10 commits intoeasybuilders:developfrom
Conversation
|
@Flamefire conflict resolution needed |
1370d43 to
146773e
Compare
|
@akesandgren Rebased |
|
I can't find a new test that actually verifies that multiple copies of the same path actually gets filtered out. |
|
@akesandgren Basically the test at https://github.com/easybuilders/easybuild-framework/pull/3770/files#diff-afa83d19ec1ee9ca4fd954c188c8e846c691fbcf4845d14e02d168a5f0cf359dL745 does test that. Maybe we can rework it to be a bit clearer in (test) intent but it certainly checks that the common case of adding a path multiple times to |
|
Ok, there's so much code here that I just got lost :-) |
|
Going in, thanks @Flamefire! |
| filtered_paths = [x for x in paths if x not in added_paths and not added_paths.add(x)] | ||
| if filtered_paths != paths: | ||
| removed_paths = paths if filtered_paths is None else [x for x in paths if x not in filtered_paths] | ||
| print_warning("Supressed adding the following path(s) to $%s of the module as they were already added: %s", |
There was a problem hiding this comment.
Small typo here, should be Suppressed (double p); fixed in #3874
There was a problem hiding this comment.
Thanks. Always forget the double double letter in that word... ;)
This basically fixes faulty EC files which result in modules like:
The idea is to use a context manager around the creation of a module, store all added paths and reject duplicate ones that way clearing the stored paths at the end.
Testcase: PyQt5-5.9.2-foss-2018a-Python-3.6.4.eb