Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

relax major version match regex in find_related_easyconfigs using for --review-pr #4385

Merged
merged 1 commit into from
Dec 26, 2023
Merged
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
2 changes: 1 addition & 1 deletion easybuild/framework/easyconfig/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ def find_related_easyconfigs(path, ec):
if len(parsed_version) >= 2:
version_patterns.append(r'%s\.%s\.\w+' % tuple(parsed_version[:2])) # major/minor version match
if parsed_version != parsed_version[0]:
version_patterns.append(r'%s\.[\d-]+\.\w+' % parsed_version[0]) # major version match
version_patterns.append(r'%s\.[\d-]+(\.\w+)*' % parsed_version[0]) # major version match
Copy link
Contributor

Choose a reason for hiding this comment

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

why not just like this:

Suggested change
version_patterns.append(r'%s\.[\d-]+(\.\w+)*' % parsed_version[0]) # major version match
version_patterns.append(r'%s\.\w+' % parsed_version[0]) # major version match

Copy link
Member Author

Choose a reason for hiding this comment

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

@smoors this makes test_find_related_easyconfigs fail, at least as it is now, because it also matches easyconfigs with different toolchains and versionsuffixes (note that these version_patterns are only part of the actual regex, the toolchain and versionsuffixes patterns are inserted in the next block)

to be clear, although my suggestion doesn't make the tests fail, I'm also not sure if it won't change the behaviour in some unintended way, which is way I marked the PR as draft :)

version_patterns.append(r'[\w.]+') # any version

regexes = []
Expand Down
Loading