Skip to content

Commit 07150a1

Browse files
committed
Enable dumping of the API using stubgen
1 parent 2812c5b commit 07150a1

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
/.pytest_cache/
77
/.venv/
88
/.vscode/
9+
/api/
910
/build/
1011
/dist/
1112
/eggs/

bin/api.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
uv run stubgen --include-private -p appose -o api/
3+
uv run stubgen --include-private -o api tests/*.py
4+
5+
# Strip leading import statements -- not needed for
6+
# API comparison with other Appose implementations.
7+
find api -name '*.pyi' | while read pyi
8+
do
9+
mv "$pyi" "$pyi.original"
10+
sed '/^\(from\|import\) /d' "$pyi.original" > "$pyi"
11+
done

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ dependencies = [
3535
[dependency-groups]
3636
dev = [
3737
"build",
38+
"mypy",
3839
"pytest",
3940
"ruff",
4041
"toml",

src/appose/service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ def __init__(
310310
inputs: Args | None = None,
311311
queue: str | None = None,
312312
) -> None:
313-
self.uuid = uuid4().hex
313+
self.uuid: str = uuid4().hex
314314
self.service = service
315315
self.script = script
316316
self.inputs: Args = {}

0 commit comments

Comments
 (0)