Skip to content

Commit 9ea2666

Browse files
Fix mypy
1 parent 047ab27 commit 9ea2666

File tree

2 files changed

+58
-3
lines changed

2 files changed

+58
-3
lines changed

Tools/jit/_targets.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,9 @@ def build(self, out: pathlib.Path, *, force: bool = False) -> None:
233233
"--enable-optimizations",
234234
}
235235
makefile = out / "Makefile"
236-
config_args = re.search(
237-
r"CONFIG_ARGS\s*=\s*'(.*)'", makefile.read_text()
238-
).group(1)
236+
match = re.search(r"CONFIG_ARGS\s*=\s*'(.*)'", makefile.read_text())
237+
assert match is not None
238+
config_args = match.group(1)
239239
copy_stencils = config_args and all(
240240
arg in JIT_ARGS for arg in config_args.split()
241241
)

cpython_growth.sh

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/
2+
3+
since="90 days ago"
4+
5+
cd cpython
6+
7+
echo Copying existing repo at $since
8+
9+
start=$(git rev-list -n 1 --before="$since" main)
10+
commits=$(git rev-list --reverse $commit..main)
11+
12+
git switch --detach $start
13+
14+
cd ..
15+
16+
rm -rf cpython-copy
17+
cp -r cpython cpython-copy
18+
cd cpython-copy
19+
rm -rf .git
20+
21+
git init > /dev/null 2>&1
22+
git config gc.auto 0 # Disable GC so we can run it later
23+
24+
git add . > /dev/null
25+
git commit -am "init" > /dev/null
26+
27+
echo GCing
28+
git gc --aggressive > /dev/null 2>&1
29+
30+
echo
31+
echo Size at $since
32+
33+
du -sh .git
34+
35+
echo
36+
echo Applying patches
37+
38+
patchdir=/tmp/cpython-patches
39+
rm -rf $patchdir
40+
mkdir $patchdir
41+
42+
git -C ../cpython format-patch -o $patchdir $commit..main > /dev/null
43+
44+
git am --3way --whitespace=nowarn --quoted-cr=nowarn --keep-cr --empty=drop $patchdir/*.patch > /dev/null
45+
46+
rm -rf $patchdir
47+
48+
echo GCing
49+
git gc --aggressive > /dev/null 2>&1
50+
51+
echo
52+
echo Size at main
53+
54+
55+
du -sh .git

0 commit comments

Comments
 (0)