mirror of
https://github.com/Tencent/WeKnora.git
synced 2026-10-25 17:51:53 +08:00
pluginsdk/python is the extension protocol for Python 3.9+, standard library only. It has the same shape as the Go SDK: - web search, parsers, connectors (NDJSON streaming with checkpoints) and a config check; - the host handshake over a unix socket with the host's token, or remote mode with HMAC-signed requests; - errors mapped to protocol codes; - a Host API client (kv); - graceful drain on SIGTERM. The Go conformance suite now also runs the Python SDK's test plugin in both modes, and plugin-sdk.yml runs the Python tests on 3.9 and 3.13. The embedded host runs runtime.kind python: - WeKnora's python3 (or WEKNORA_PLUGIN_PYTHON) runs the entry, with vendor/ and the package root on PYTHONPATH. - No bytecode is written into the shared package. - On Windows, where Python has no unix sockets, the plugin listens on a loopback port. - Installing checks the entry and the interpreter. examples/plugins/notebooks is a Jupyter notebook parser written with it: code, text outputs and charts, with a workspace setting for outputs.
24 lines
555 B
TOML
24 lines
555 B
TOML
[build-system]
|
|
requires = ["setuptools>=64"]
|
|
build-backend = "setuptools.build_meta"
|
|
|
|
[project]
|
|
name = "weknora-plugin"
|
|
version = "0.1.0"
|
|
description = "Build WeKnora code plugins in Python"
|
|
readme = "README.md"
|
|
requires-python = ">=3.9"
|
|
license = { text = "MIT" }
|
|
authors = [{ name = "WeKnora" }]
|
|
classifiers = [
|
|
"Programming Language :: Python :: 3",
|
|
"Operating System :: OS Independent",
|
|
]
|
|
dependencies = []
|
|
|
|
[project.urls]
|
|
Homepage = "https://github.com/Tencent/WeKnora/tree/main/pluginsdk/python"
|
|
|
|
[tool.setuptools.packages.find]
|
|
where = ["src"]
|