Skip to content

Commit

Permalink
Fix regexp (mlflow#3887)
Browse files Browse the repository at this point in the history
Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
  • Loading branch information
harupy committed Apr 8, 2021
1 parent 2e6ac42 commit e99c51b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions dev/set_matrix.py
Expand Up @@ -195,7 +195,11 @@ def get_changed_flavors(changed_files, flavors):
['pytorch', 'xgboost']
>>> get_changed_flavors(["mlflow/xgboost.py"], flavors)
['xgboost']
>>> get_changed_flavors(["tests/xgboost/test_xgboost_autolog.py"], flavors)
>>> get_changed_flavors(["tests/xgboost/test_xxx.py"], flavors)
['xgboost']
>>> get_changed_flavors(["tests/xgboost_autolog/test_xxx.py"], flavors)
['xgboost']
>>> get_changed_flavors(["tests/xgboost_autologging/test_xxx.py"], flavors)
['xgboost']
>>> get_changed_flavors(["README.rst"], flavors)
[]
Expand All @@ -204,7 +208,10 @@ def get_changed_flavors(changed_files, flavors):
"""
changed_flavors = []
for f in changed_files:
match = re.search(r"^(mlflow|tests)/(.+?)(\.py|/)", f)
pattern = r"^(mlflow|tests)/(.+?)(_autolog(ging)?)?(\.py|/)"
# ~~~~~
# # This group captures a flavor name
match = re.search(pattern, f)

if (match is not None) and (match.group(2) in flavors):
changed_flavors.append(match.group(2))
Expand Down

0 comments on commit e99c51b

Please sign in to comment.