Skip to content

Commit 897084c

Browse files
committed
Do more api postprocessing
1 parent 375626b commit 897084c

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

bin/api.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22
uv run stubgen --include-private -p appose -o api/
33
uv run stubgen --include-private -o api tests/*.py
44

5-
# Strip leading import statements -- not needed for
6-
# API comparison with other Appose implementations.
5+
# Transform .pyi inputs to .api outputs.
6+
# The .api files are merely lightly postprocessed stub files to
7+
# make them easily diffable with other Appose implementations.
78
find api -name '*.pyi' | while read pyi
89
do
9-
mv "$pyi" "$pyi.original"
10-
sed -e '/^from /d' -e '/^import /d' "$pyi.original" > "$pyi"
10+
sed \
11+
-e '/^from /d' -e '/^import /d' \
12+
-e "s/'Task'/Task/g" \
13+
"$pyi" > "${pyi%.pyi}.api"
1114
done

0 commit comments

Comments
 (0)