mirror of
https://github.com/qdrant/qdrant.git
synced 2026-09-21 13:37:46 -05:00
Add just py-stubs recipe
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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')]
|
||||
|
||||
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user