|
3 | 3 | import json
|
4 | 4 | import os
|
5 | 5 | import sys
|
6 |
| -from bot_tools.bot_funcs import Bot, test_dependencies, pr_test_keys as bot_pr_test_keys |
| 6 | +from bot_tools.bot_funcs import Bot, test_dependencies, pr_test_keys as bot_pr_test_keys, default_python_versions |
7 | 7 |
|
8 |
| -pr_test_keys = list(bot_pr_test_keys) + ['Codacy'] |
| 8 | +pr_test_keys = [(t, default_python_versions[t]) for t in bot_pr_test_keys] + ['Codacy'] |
| 9 | + |
| 10 | +def get_name_from_key(name_key): |
| 11 | + """ |
| 12 | + Get the name from a name key by dropping the information about the Python version. |
| 13 | +
|
| 14 | + Get the name from a name key by dropping the information about the Python version. |
| 15 | +
|
| 16 | + Parameters |
| 17 | + ---------- |
| 18 | + name_key : str | tuple |
| 19 | + The key used to uniquely identify the run configuration. |
| 20 | +
|
| 21 | + Returns |
| 22 | + ------- |
| 23 | + str |
| 24 | + A string indicating the run tool (but not the Python version). |
| 25 | + """ |
| 26 | + if isinstance(name_key, tuple): |
| 27 | + # Ignore Python version |
| 28 | + return name_key[0] |
| 29 | + return name_key |
9 | 30 |
|
10 | 31 | if __name__ == '__main__':
|
11 | 32 | # Parse event payload from $GITHUB_EVENT_PATH variable
|
|
15 | 36 | with open(os.environ["GITHUB_EVENT_PATH"], encoding="utf-8") as event_file:
|
16 | 37 | event = json.load(event_file)
|
17 | 38 |
|
18 |
| - name = event['check_run']['name'] |
| 39 | + full_name = event['check_run']['name'] |
19 | 40 |
|
20 | 41 | print(event)
|
21 | 42 |
|
|
30 | 51 | except StopIteration:
|
31 | 52 | pr_id = 0
|
32 | 53 |
|
33 |
| - name_key = bot.get_name_key(name) |
34 |
| - if isinstance(name_key, tuple): |
35 |
| - # Ignore Python version |
36 |
| - name_key = name_key[0] |
| 54 | + name = get_name_from_key(bot.get_name_key(full_name)) |
37 | 55 |
|
38 | 56 | runs = bot.get_check_runs()
|
39 | 57 |
|
|
54 | 72 | # Not a Pyccel triggered test
|
55 | 73 | continue
|
56 | 74 | deps = test_dependencies.get(q_key[0], ())
|
57 |
| - if name_key in deps: |
58 |
| - if all(d in successful_runs for d in deps): |
| 75 | + if name in deps: |
| 76 | + if all(d in (get_name_from_key(r) for r in successful_runs) for d in deps): |
59 | 77 | q_name, python_version = q_key
|
60 | 78 | workflow_ids = None
|
61 | 79 | if q_name == 'coverage':
|
|
0 commit comments