Add just py-stubs recipe

This commit is contained in:
xzfc
2026-09-18 06:37:54 +00:00
parent 8d44926c9f
commit 1c872f7011
3 changed files with 22 additions and 2 deletions
+5
View File
@@ -141,6 +141,11 @@ jobs:
working-directory: lib/edge/python
run: just py-build
- name: 🐍 Check Python stubs
if: runner.os == 'Linux'
working-directory: lib/edge
run: just py-stubs
- name: 🐍 Run Python examples
working-directory: lib/edge
run: just py-examples
+15
View File
@@ -63,6 +63,21 @@ py-build:
uv pip install requests
uvx {{maturin}} develop --no-default-features --features abi3
# 🐍 Generate python/qdrant_edge.pyi
[working-directory: 'python', script]
py-stubs:
STUBS=$(mktemp -d --suffix=.qdrant-edge-stubs)
trap "rm -rf ${STUBS}" EXIT
uvx {{maturin}} generate-stubs --no-default-features --features abi3 -o "$STUBS"
{
echo '# This file is auto-generated by `just py-stubs`'
echo "from __future__ import annotations"
cat "${STUBS}/qdrant_edge/__init__.pyi"
} > "$STUBS/out.pyi"
uvx black --quiet "$STUBS/out.pyi"
mv "$STUBS/out.pyi" qdrant_edge.pyi
# 🐍 Run Python examples; Specify example with `-e examples/demo.py`
[working-directory: 'python', script]
[positional-arguments, arg('e', short = 'e')]
+2 -2
View File
@@ -7,7 +7,7 @@ edition = "2024"
[lib]
name = "qdrant_edge"
crate-type = ["cdylib"]
crate-type = ["cdylib", "rlib"]
[lints]
workspace = true
@@ -40,4 +40,4 @@ features = ["into"]
[dependencies.pyo3]
version = "0.29.0"
features = ["uuid"]
features = ["uuid", "experimental-inspect"]