Skip to main content

ex-minimal-plugin-py

ex-minimal-project-py 的 plugin 擴展。由專案以路徑來源([tool.uv.sources] 的 editable path)掛上:Python 的 import 走發布名對應的 import 套件名,帶連字號的目錄無法直接 import;同時保持可發布形態——中繼欄位、參數宣告與授權都隨套件出貨,版號是 1.0.0 正式版。

plugin 掛在求值管線的三個生命週期上,順序固定:

  1. prepare——唯一 async 的階段,跑在收集遍之前。真實 plugin 在這裡請求外部資源,或以 ctx.cacheDir 快取、ctx.writeLock 記錄鎖定,再經閉包把資料交給後續階段。
  2. transform——改寫遍。改寫既有節點一律經 ctx 操作函式(appendContent/patchConfig),型別安全、變更可追蹤、衝突可偵測;也可在此以 define* 新增節點。
  3. validate——解析遍,核心檢查在先。對註冊表做結構驗證並回傳診斷,空清單即通過。

plugin 產出的是節點而非檔案:要落地的內容以 define* 新增資源節點,由核心落地為產物。

在本專案的接法

promptex.config.py 以 plugins=[create_plugin()] 掛上。跑 uv run promptex build --install . 後,兩個平台的 example-rule 產物末尾都會多出本 plugin 在 transform 追加的那一行——那是它有生效的可見證據。

參數宣告

參數宣告(標準 JSON Schema)住import 套件目錄裡的 promptex.config.schema.json,由 __init__.py 自己讀進來,隨中介表示交給讀取端;promptex config declare ex-minimal-plugin-py 讀的是同一份檔案。

發布

發布走專案的發布流程(Trusted Publishing),不在套件目錄手動發布,步驟見專案根 README 的「發布」一節。

版號 1.0.0 是正式版,與 npm、crates.io 側逐字相同。安裝端照一般寫法即可:pip install ex-minimal-plugin-py(或 uv pip install ex-minimal-plugin-py),不需要 --pre。

SDK 依賴是 dependencies 的 promptex-py,指向 registry 上正式發布的版本。發布驗證、消費端安裝與實際執行用的都是同一份 SDK。

名稱刻意不帶 promptex-plugin- 前綴——那是給要被消費端搜尋到的套件用的;本擴展的定位是示範,改以 keywords 的 promptex-plugin 承載可搜尋性。

Metadata

Release files for ex-minimal-plugin-py 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ex-minimal-plugin-py 1.1.0
File Size Uploaded Provenance
ex_minimal_plugin_py-1.1.0.tar.gz 11.1 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ex-minimal-plugin-py 1.1.0
File Interpreter ABI Platform
ex_minimal_plugin_py-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 20.3 kB

Release files / ex_minimal_plugin_py-1.1.0.tar.gz

Download URL ex_minimal_plugin_py-1.1.0.tar.gz
Size 11.1 kB
Tags Source
SHA-256 checksum
How to use checksums
69d3fe4074c1a58ba83dd33e8de6117234e6f439115007c0e36e083f4d780712
BLAKE2b-256 checksum
How to use checksums
4795232c7390abd9287e306b426a78691c9ab4cf13e47846b5f07c4d3c59ab32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Release files / ex_minimal_plugin_py-1.1.0-py3-none-any.whl

Download URL ex_minimal_plugin_py-1.1.0-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3f2048cee800e8f7c59b7e38fd9169214a9c0cbef4d89d201bfafc7203a1ea61
BLAKE2b-256 checksum
How to use checksums
f0475092b00f91520d3c27835fa20c9d35fc06b2bdb1c6d3010bf776d9059676
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Security for ex-minimal-plugin-py 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ex_minimal_plugin_py-1.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page