File tree Expand file tree Collapse file tree 6 files changed +26
-36
lines changed Expand file tree Collapse file tree 6 files changed +26
-36
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -155,14 +155,10 @@ jobs:
155
155
timeout-minutes : 30
156
156
steps :
157
157
- uses : actions/checkout@v2
158
- - name : Set up Node.js
159
- uses : actions/setup-node@v1
160
- with :
161
- node-version : 12.x
162
158
- name : Set up Python
163
159
uses : actions/setup-python@v2
164
160
with :
165
- python-version : 3.8
161
+ python-version : 3.9
166
162
- name : Install dependencies
167
163
run : |
168
164
python -m pip install --upgrade pip
Original file line number Diff line number Diff line change 7
7
runs-on : ubuntu-latest
8
8
steps :
9
9
- uses : actions/checkout@v2
10
- - name : Set up Node.js
11
- uses : actions/setup-node@v1
12
- with :
13
- node-version : 12.x
14
10
- name : Set up Python
15
11
uses : actions/setup-python@v2
16
12
with :
17
- python-version : 3.8
13
+ python-version : 3.9
18
14
- name : Install dependencies
19
15
run : |
20
16
python -m pip install --upgrade pip
Original file line number Diff line number Diff line change 1
- playwright /__pycache__ /
1
+ ** /__pycache__ /
2
2
driver /
3
3
playwright /driver /
4
4
playwright.egg-info /
7
7
** /* .pyc
8
8
env /
9
9
htmlcov /
10
- .coverage
10
+ .coverage *
11
11
.DS_Store
12
12
.vscode /
13
13
.eggs
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
import re
2
+ from pathlib import Path
2
3
3
4
from playwright .sync_api import sync_playwright
4
5
5
- with sync_playwright () as p :
6
- r = open ("README.md" , "r" )
7
- text = r .read ()
8
- for browser_type in [p .chromium , p .firefox , p .webkit ]:
9
- rx = re .compile (
10
- r"<!-- GEN:" + browser_type .name + r"-version -->([^<]+)<!-- GEN:stop -->"
11
- )
12
- browser = browser_type .launch ()
13
- text = rx .sub (
14
- f"<!-- GEN:{ browser_type .name } -version -->{ browser .version } <!-- GEN:stop -->" ,
15
- text ,
16
- )
17
- browser .close ()
18
6
19
- w = open ("README.md" , "w" )
20
- w .write (text )
21
- w .close ()
7
+ def main () -> None :
8
+ with sync_playwright () as p :
9
+ readme = Path ("README.md" ).resolve ()
10
+ text = readme .read_text (encoding = "utf-8" )
11
+ for browser_type in [p .chromium , p .firefox , p .webkit ]:
12
+ rx = re .compile (
13
+ r"<!-- GEN:"
14
+ + browser_type .name
15
+ + r"-version -->([^<]+)<!-- GEN:stop -->"
16
+ )
17
+ browser = browser_type .launch ()
18
+ text = rx .sub (
19
+ f"<!-- GEN:{ browser_type .name } -version -->{ browser .version } <!-- GEN:stop -->" ,
20
+ text ,
21
+ )
22
+ browser .close ()
23
+ readme .write_text (text , encoding = "utf-8" )
24
+
25
+
26
+ if __name__ == "__main__" :
27
+ main ()
You can’t perform that action at this time.
0 commit comments