Skip to content

feat: add default python-sdk feature and unify SDK precedence - #3

Open
Shinonome-Ryoko14 wants to merge 1 commit into
mainfrom
feat/python-sdk-feature
Open

Shinonome-Ryoko14 wants to merge 1 commit into
mainfrom
feat/python-sdk-feature

Conversation

@Shinonome-Ryoko14

Copy link
Copy Markdown
Collaborator

配合 mcpp-community/mcpp-plugins#72(rules-python Python SDK 分层归属设计)的同步改动。

改动说明

  • mcpp.toml:
    • 移除无条件的 [xlings.workspace] "xim:python" = "3.13.12" 声明。
    • 新增默认开启的 python-sdk feature(default = ["runtime", "python-sdk"]),在 [feature-xlings.python-sdk] 中声明 "xim:python" = "3.13.12"。
    • 默认用户继续享受零配置开箱即用;需要自定义 Python SDK 的用户可通过 default-features = false, features = ["runtime"] 一键关闭自动拉取。
  • build.mcpp:
    • 将 <Python.h> 查找优先级与 mcpp.rules.python 彻底统一,确保使用共享环境变量时 nb_runtime.cpp 与消费方扩展始终命中同一 Python ABI:
      1. MCPP_PYTHON_INCLUDE_DIR(严格模式:缺少 Python.h 直接报错)
      2. MCPP_PYTHON_EXECUTABLE(严格模式:无效时直接报错,不再静默回落到 xim:python 或 PATH)
      3. VIRTUAL_ENV
      4. xim:python(来自 python-sdk feature 或消费方更近的 [xlings.workspace])
      5. PATH 上的 python3 / python
  • 文档(docs/usage.md、README.md、README.zh.md):
    • 补充 python-sdk feature 说明、自定义 SDK 时的关闭方式以及统一后的查找优先级。

验证

  • 默认 features(runtime、python-sdk)下 mcpp build --strict 与 mcpp test 全部通过。
  • 已验证 VIRTUAL_ENV / MCPP_PYTHON_EXECUTABLE 优先级高于 xim:python,且无效的 MCPP_PYTHON_EXECUTABLE 会明确报错退出。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant