-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
85 lines (70 loc) · 5 KB
/
run.py
File metadata and controls
85 lines (70 loc) · 5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import yaml
with open('repos.yaml', 'r') as file:
repos = yaml.safe_load(file)
r_release = "4.5.0"
r_devel = "4.6.0"
r_oldrel = "4.4"
r_wasm = "4.2.0"
template = """|
[`{repo_name}`](https://github.com/{repo}/)
| [](https://github.com/{repo}/actions/workflows/check.yaml?query=branch%3Amain)
| [](https://github.com/{repo}/actions/workflows/docs.yaml?query=branch%3Amain)
| [](https://github.com/{repo}/actions/workflows/scheduled.yaml?query=branch%3Amain)
| [](https://github.com/{repo})
|
[](https://pharmaverse.r-universe.dev/{repo_name}/)
<br>
[](https://pharmaverse.r-universe.dev/{repo_name}/)
<br>
[](https://pharmaverse.r-universe.dev/{repo_name}/)
<br>
[](https://pharmaverse.r-universe.dev/{repo_name}/)
<br>
[](https://pharmaverse.r-universe.dev/{repo_name}/)
<br>
[](https://pharmaverse.r-universe.dev/{repo_name}/)
<br>
[](https://pharmaverse.r-universe.dev/{repo_name}/)
<br>
[](https://pharmaverse.r-universe.dev/{repo_name}/)
<br>
[](https://pharmaverse.r-universe.dev/{repo_name}/)
<br>
[](https://pharmaverse.r-universe.dev/{repo_name}/)
|
[](https://pharmaverse.r-universe.dev/{repo_name}/)
<br>
[](https://pharmaverse.r-universe.dev/{repo_name}/)
<br>
[](https://pharmaverse.r-universe.dev/{repo_name}/)
|
[](https://pharmaverse.r-universe.dev/{repo_name}/)
<br>
[](https://pharmaverse.r-universe.dev/{repo_name}/)
|
[](https://pharmaverse.r-universe.dev/{repo_name}/)
<br>
[](https://pharmaverse.r-universe.dev/{repo_name}/)
<br>
[](https://pharmaverse.r-universe.dev/{repo_name}/)
|
[](https://pharmaverse.r-universe.dev/{repo_name}/)
"""
no_columns = template.count('|')
columns = ["Repository", "Main check", "Main docs", "Main scheduled", "Main coverage", "Pharmaverse checks", "Linux binaries", "Mac binaries", "Windows binaries", "WebAssembly binaries"]
max_column_length = max(len(col) for col in columns)
columns_fixed = [col + "<br>" + "_" * max_column_length for col in columns] # this is to keep the column width fixed in the markdown table
table_header = "| " + " | ".join(columns_fixed) + " |\n" + "|:---:" * no_columns + "|\n"
res = table_header
for repo in repos:
repo_name = repo.split('/')[1]
repo_res = template.format(**{
'shield_badge': "https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fpharmaverse.r-universe.dev%2Fapi%2Fpackages%2F",
'repo_name': repo_name,
'repo' : repo,
'r_devel' : r_devel, 'r_release' : r_release, 'r_oldrel' : r_oldrel,'r_wasm' : r_wasm
})
repo_res = repo_res.replace('\n', '')
res = res + repo_res + "\n"
with open('README.md', 'w') as file:
file.write(res)